LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2011, 08:21 AM   #1
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
disown cannot find ones self, or a child


I'm in a nested shell trying to use disown to re-root myself as well as a child. Looks like this:
Code:
# echo $$
1234

# disown 1234
disown: job not found: 1234

# disown $$
disown: job not found: 1234

# pgrep mychild
2222

# disown 2222
disown: job not found: 2222
This is in zsh. The goal is to have process 1 (the root of all processes) to become the parent.

Last edited by jgombos; 06-01-2011 at 08:25 AM.
 
Old 06-01-2011, 09:15 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Can't you simply start the jobs with a trailing "&"?
 
Old 06-01-2011, 10:34 AM   #3
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by sundialsvcs View Post
Can't you simply start the jobs with a trailing "&"?
That would only background the new job. The new job would still be a child of the current shell, which means when the current shell terminates, the child does too.
 
Old 06-01-2011, 10:59 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The disown built-in accepts a jobspec as argument, not a PID. If you have a running job whos job ID is 1, the related disown syntax is
Code:
disown %1
where %1 is the jobspec. If you want to disown all the jobs from the current shell use
Code:
disown -a
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to find parent and child process? newbie01.linux Linux - Newbie 2 04-21-2011 05:33 AM
Find all child processes charithmax Linux - Newbie 2 11-17-2010 05:28 AM
Find number of child processes (C, POSIX) polymath Programming 2 05-28-2010 05:25 AM
How to use nohup and disown in a script? jf.argentino Programming 11 10-06-2009 07:02 AM
disown problem (sh: disown: not found) grayFalcon Linux - Server 2 01-07-2008 06:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration