I really cant understand whats wrong with this:
File looks like this:
55 11
Code:
cost=30
a= cut -c9-12 File
let a=${a}+${cost}
echo $a
The answer echo should echo 11+30(cost) however the output looks like this:
11
30
And also is there anyway to grep $2 without awk? or maybe awk grep $2?
wouldnt mind get this loop to work instead
for i in cut -c1-12 awk ' $2 ~ "^[0-9]" && $2 > 0 {$2='$i'} ' 5 `