When I run this command in the bash terminal it works:
awk '{ sum += $1 } END { print sum }' /user/dnaiel/test.txt > /user/dnaiel/sum.txt
But when I run this:
bsub -q priority -R'rusage[mem=2000]' -oo bin${count}.out -eo bin${count}.err \
"awk '{ sum += $1 } END { print sum }' /user/dnaiel/test.txt > /user/dnaiel/sum.txt"
It does not work. I also tried changing ' to \' but also does not work.
I get the following errors: for the first case:
awk: { sum += } END { print sum }
awk: ^ syntax error
for the case I used \'
awk: '{
awk: ^ invalid char ''' in expression
Any ideas where I am messing up with the syntax? I am quite puzzled.
Thanks