Because ‘nohup’ expects a single-word command and its arguments – not a shell loop construct. You’d have to use:
nohup sh -c 'for i in mydir/*.fasta; do ./myscript.sh "$i"; done >output.txt' &
Because ‘nohup’ expects a single-word command and its arguments – not a shell loop construct. You’d have to use:
nohup sh -c 'for i in mydir/*.fasta; do ./myscript.sh "$i"; done >output.txt' &