I am trying to run bash script which run 8 for loops simultaneously.
One of the for loop likes below
for i in 00 01 02 03 04 ; do cat $INDIR/sys*$1.$i*csv | \ awk -F '\xac' 'BEGIN{OFS=";";} ($4 == 10) { $1=$1; print }'> $OUTDIR/$1_$i.csv So I have converted into following syntax to run with nohup
nohup bash -c 'for i in 00 01 02 03 04; do cat $INDIR/rti*$1.$i*csv| \ awk -F \'\\xac\' \'BEGIN{OFS=\";\";} ($4==10) { $1=$1; print }\'>$OUTDIR/$i.csv;done' & But I am getting following error
test.sh: line 9: syntax error near unexpected token `(' test.sh: line 9: `nohup bash -c 'for i in 00 01 02 03 04; do cat $INDIR/rti*$1.$i*csv|awk -F \'\\xac\' \'BEGIN{OFS=\";\";} ($4==10) { $1=$1; print }\'>$OUTDIR/$i.csv;done' & ' I also tried with following code changes
nohup sh -c '<code>' nohup /bin/bash -c '<code>' \'\xac\'
but no progress.
However, my for loop works without nohup.
'for ...|awk -F \'quoted, then the rest is unquoted since the following single-quotes are all escaped.