1

syntax errors in a bash script executed from tcsh

view story
linux-howto

http://unix.stackexchange.com – I write the line below in order to verify if first or second fields of list of numbers are equal to 146 I want to run the line from tcsh shell with one line as bash shell please advice what the problem here in the syntax ? echo $numbers 146 146 0 16 16 10 42 12 10 32 32 3 2 32 26 tcsh bash -c 'for i in 1 2; do if [ 146 = `echo $numbers | cut -f$i -d' ' ` ]; then echo "NUM is OK "; fi done' The errors: ` ]; then echo "NUM is OK "; fi done: -c: line 0: unexpected EOF while looking for matching ``' ` ]; then echo "NUM is OK "; fi done: -c: line 1: syntax error: unexpected end of file (HowTos)