osx - trouble understanding shell control structures -


i'm writing shell script run on mac osx terminal. here's simplified example of i'm trying do:

list="../../data/fixed_data/test_games_subjects.csv" sed 1d $list | while ifs="," read f1 f2 f3 f4     if [ "$f4" != "na" ]           echo "do stuff"     fi done < $list 

test_games_subjects.csv has list of names , associated ids, f4 long string of characters, unless reads "na". file saved "windows comma separated (.csv) file. made excel.

no matter value of f4, body of if statement executed. idea i'm doing wrong?


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -