Operating System - Linux
1753943 Members
9028 Online
108811 Solutions
New Discussion юеВ

how to put two commands in nohup

 
hubin_1
Occasional Contributor

how to put two commands in nohup

In the "man nohup",it should be " nohup (date; who)". but it donot work.

$ nohup (date; who)
sh: Syntax error: `(' is not expected.

How should I do?
7 REPLIES 7
RAC_1
Honored Contributor

Re: how to put two commands in nohup

Why not
nohup date;nohup who
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: how to put two commands in nohup

Hello,

$ nohup "(date; who)"

will help you.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Yogeeraj_1
Honored Contributor

Re: how to put two commands in nohup

hi,

you can also always put your commands in a single script and do the same

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
hubin_1
Occasional Contributor

Re: how to put two commands in nohup

1. What i want to do is
dd,then compress the dd file
so,i can not use nohup dd...;nohup compress ..

2. $ nohup "(date; who)"
Sending output to nohup.out
nohup: (date; who): No such file or directory
RAC_1
Honored Contributor

Re: how to put two commands in nohup

no hup dd | nohup compress
will do it.
Test it on a small file though.
There is no substitute to HARDWORK
hubin_1
Occasional Contributor

Re: how to put two commands in nohup

nohup dd if=/dev/vgnjs03/rnzlist187 of=/jsbak1/zhjs2tape/zhjsdb200512/ZHJS_LIST_WJJS_200512.75 bs=1024000 | nohup compress /jsbak1/zhjs2tape/zhjsdb200512/ZHJS_LIST_WJJS_200512.75

the file ZHJS_LIST_WJJS_200512.75 do not been compressed. :(
MarkSyder
Honored Contributor

Re: how to put two commands in nohup

Try this:

nohup dd|wait|nohup compress

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing