I am using a small script to divide some numbers in a given file and display the output in another file. I am getting the following error
basename: invalid option -- '5'
Try `basename --help' for more information.
(standard_in) 1: syntax error
The script is :
#!/bin/bash
for i in `cat ./eff_cal.txt`
do
some=`basename $i -lt`
output=`echo $some*100/128 | bc -l`
echo "`basename $i`---- $output" >> some.txt
done
Is it possible by some way to divide negative numbers? It would be helpful if someone can give some pointers.
I am taking the values one by one from the file and storing in a variable some. I am completely new to scripting so can you point if there is some other way to do it? Thank you in advance.