[Novalug] nohup and chaining commands

Jon Taimanglo jontaimanglo@gmail.com
Thu Oct 23 08:21:45 EDT 2008


I want to chain together multiple commands.  The first command usually takes
a while to run and I usually background it:

nohup cmd1 &

The problem ends up being that when the file is created from this command
the permissions are set as 600.  I want to chmod the file when cmd1 (cmd1
allows me to name the output file as an argument) is done then cp it to a
shared directory (however, I can cp then chmod - as long as cmd1 has
completed).

What is the proper format for chaining these commands?  I want to be able to
fire this off at the command line and close my putty session and know that
when cmd1 is done, someone else with access to the shared directory can view
the output.

I don't think the following would work, but would like to know what would.

nohup cmd1 &; chmod 600 <outputfilefrom cmd1>; cp -p <outputfilefrom cmd1>
/shared/dir

Thanks.

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20081023/180468fe/attachment.htm>


More information about the Novalug mailing list