If I use the below
cut -c37-48, the minus sign does not get appended to the number, as the sign is in the 36th Position.
But, If I use cut -c36-48, the minus sign appears infront of the number, but for positive numbers, it throws an error.
How can this be resolved..
system
2
please show sample input line/file for us to get exact idea on it.
Scott
3
You mean cut throws an error? Unlikely, so perhaps you could also post your script?
abc=`echo <filename> | cut -c37-48`
Scott
5
You're trying to cut a piece of the <filename> (as opposed to a piece of the file itself)?
Please show a part of the input file (filename), and such as it is, change your command to:
abc=$(cut -c37-48 filename)
system
6
but what is there in filename ??
show sample lines please..
while read each_rec
do
fin_div_count=`echo "${each_rec}" | cut -c1-2`
if [ ${fin_div_count} -eq 01 ]
then
abc=`echo "${each_rec}" | cut -c37-48 | bc`
Can you also post an example of a line and the expected output?
And please use code tags!