[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash script error



On 2007-05-22, L.V.Gandhi <lvgandhi@gmail.com> wrote:
(tidied up for clarity)

+----------------------------------------------------+

But when it is put in a script file, than command line as

#!/bin/sh
rm -f highs
for line in $(cat temp.csv)
do
high52=$(echo $line|cut -d, -f4)
high=$(echo $line|cut -d, -f2)
stock=$(echo $line|cut -d, -f1)
if [[ $high52 = $high ]]
then
echo $stock > highs
fi
done

I get error as
/home/lvgandhi/bin/gethilo: 12: [[: not found
Any suggestions please?

+---------------------------------------------------+

It works for me. I'd check to see where /bin/sh is pointing - 
it's usually a symlink to /bin/bash, but maybe yours is pointed at
something else. Assuming you just pasted the script into your post
there are no typos...

HTH,

Tyler



Reply to: