- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- nohup problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 06:49 AM
10-22-2004 06:49 AM
nohup (command1; command2)
However, when I try the following:
nohup (sleep 10; echo $!) &
I get the following error:
ksh: syntax error: '(' unexpected
Anyone know how I can get the PID for the first command?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 06:52 AM
10-22-2004 06:52 AM
Re: nohup problem
echo "Process ID: $PID:
Try command witout the parenthesis.
sEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 06:56 AM
10-22-2004 06:56 AM
Re: nohup problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 06:57 AM
10-22-2004 06:57 AM
Re: nohup problem
nohup `sleep 10; echo $!` &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:01 AM
10-22-2004 07:01 AM
Re: nohup problem
nohup sleep; echo $!) &
USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:02 AM
10-22-2004 07:02 AM
Re: nohup problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:09 AM
10-22-2004 07:09 AM
Re: nohup problem
Try this instead:
nohup `(sleep 10; echo $!)` &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:14 AM
10-22-2004 07:14 AM
Re: nohup problem
That won't work - as ; seperates cmmands - serially - that is, nohup will do first command, after done, the second...
Only way I see is:
nohup command &
ps -ef |grep command |awk '{print $2}`
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:22 AM
10-22-2004 07:22 AM
Re: nohup problem
just typing:
sleep 10 &
then echo $! returns the correct number... when ya start including nohup it starts getting messy cause THAT is considered the last job that ran in the background
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:27 AM
10-22-2004 07:27 AM
Re: nohup problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:30 AM
10-22-2004 07:30 AM
Re: nohup problem
sha1:root:/ # nohup sleep 20 &
[1] 19692
sha1:root:/ # Sending output to nohup.out
sha1:root:/ # echo $!
19692
sha1:root:/ # ps -ef |grep 19692
root 19692 23610 0 13:30:13 pts/8 00:00 sleep 20
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:46 AM
10-22-2004 07:46 AM
Re: nohup problem
That's exactly what I need. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2004 07:55 AM
10-22-2004 07:55 AM