LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 04: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, 01:48 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 673

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, 04: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 12:21 AM
[SOLVED] SQL commands inside bash script XardasCZ Linux - Server 1 05-05-2011 10:08 AM
how to give commands inside program sarathius Programming 2 04-28-2008 12:17 PM
RE in commands like match() inside awk. stalin.varanasi Linux - Newbie 2 12-12-2007 11:31 PM
where to place certiain commands inside shell script beeblequix Linux - Newbie 8 08-10-2006 11:12 AM


All times are GMT -5. The time now is 06:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration