I have file like below
list
1
I want to write a script that will check the file and ad "zero" 0 in front if the number is less then 10. I have written below script but does not work. Please help.
tmp_LIST=`echo list`
len_tmp_LIST=`scat $tmp_LIST | awk '{print length}'`
if ($len_tmp_LIST -eq 1)
then
{
LIST=`echo 0$tmp_LIST`
cat $LIST
}
else
{
LIST=$tmp_LIST
}
fi
list
1
I want to write a script that will check the file and ad "zero" 0 in front if the number is less then 10. I have written below script but does not work. Please help.
tmp_LIST=`echo list`
len_tmp_LIST=`scat $tmp_LIST | awk '{print length}'`
if ($len_tmp_LIST -eq 1)
then
{
LIST=`echo 0$tmp_LIST`
cat $LIST
}
else
{
LIST=$tmp_LIST
}
fi