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
Post a Comment