LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2004, 02:15 PM   #1
dpillay
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
Continuing a script on a new subshell


Hello ppl,

Well, here's my problem, consider that I'm running a script on a shell, which after a chroot opens a new subshell, what I want here is for my original script to continue running on this new subshell. Is this possible?

Thank you for your time,
dinesh.
 
Old 05-29-2004, 06:32 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Why so difficult?
When the chrooted subshell is running, the original will wait until the subshell exits, I suppose? (i.e. the subshell doesn't run in the background). Then why not have two scripts. The first one:
Code:
#!/bin/bash
echo "first part"
chroot /some/dir /path/to/secondscript.sh
and the second:
Code:
#!/bin/bash
echo "second part: chrooted"
 
Old 05-29-2004, 07:26 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I was thinking of suggesting something along those lines as well. If the two processes need to "communicate", then you might have to put in some sort of temporary file. For instance, if you want the new shell to inherit some variables, then the first script (before the chroot) should dump whatever variables the second script needs in a file that's accessible in the chroot environment. I would think formating it like:

variable_name=value

would be the simplest since you could simply "source" it from the second script.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Startup scripts not continuing after Shorewall script charleswj Slackware 4 10-11-2005 03:47 PM
Continuing downloads after logout nukeu666 Linux - Newbie 3 08-03-2004 11:24 AM
mc subshell.c: read (subshell_pty...): rickenbacherus Linux - Software 2 07-14-2004 07:14 PM
Need help with continuing problem BajaNick Linux - Software 3 09-28-2003 11:07 PM
continuing ftp problem cosmoh2o Linux - Networking 10 02-08-2003 01:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 AM.

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