LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-26-2012, 05:09 PM   #1
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
run commands inside chroots


hello ,

i'd like to run something like this

Code:
#! /bin/sh

chroot /<dir>
commands1
commands2
.
.
.
commandN
please note that command<1-N> should be executed inside the chroot jail

regards
 
Old 04-27-2012, 02:48 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 668

Rep: Reputation: 134Reputation: 134
Somewhere under /dir create script,
Code:
#! /bin/sh


commands1
commands2
.
.
.
commandN
And then run it as following:
Code:
chroot /dir /path/to/your/script
Note that /path/to/your/script should be without "/dir"
 
1 members found this post helpful.
Old 05-13-2012, 05:46 PM   #3
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Original Poster
Rep: Reputation: 40
hi ,

actually this solution is not satisfactory , i've already tried it btw
i'm trying to avoid running the commands in a separate script !

any other way to do that ?

cheers
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating execution of commands inside a program deeptisjains Linux - Newbie 1 01-02-2012 01:21 AM
[SOLVED] SQL commands inside bash script XardasCZ Linux - Server 1 05-05-2011 11:08 AM
how to give commands inside program sarathius Programming 2 04-28-2008 01:17 PM
RE in commands like match() inside awk. stalin.varanasi Linux - Newbie 2 12-13-2007 12:31 AM
where to place certiain commands inside shell script beeblequix Linux - Newbie 8 08-10-2006 12:12 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration