I have several lists and want to run some commands over them. As lists are long I want to run those commands parallel to each other, hence using nohup
.
For every item I tried to echo
a loop that contains a nohup command, but it doesn't work - cat another_list_of_names
reads to stdout, but not into ./tools
. First cat
in for a in $(cat list_of_names)
sends list to loop, but echo
'ed for b in $(cat another_list_of_names)
sends it to stdout.
How can I set those nohup commands running in parallel (is it possible to run nohup
with echo
)?
for a in $(cat list_of_names)
do
ID=`echo $a`
mkdir ${ID}
echo "
nohup sh -c '
for b in $(cat another_list_of_names)
do
./tools $b $a >> ${ID}/output
done' &
"
done
${ID}
is a directory and you are sendingstdout
to that. Don't you need to send it to a file? Also, in the third line, you can simply sayID=$a
. Or better still, useID
in loop header. – unxnut May 28 '13 at 12:01cat another_list_of_names
reads list into stdout, but not into./tools
. – Pgibas May 28 '13 at 12:26