LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2009, 03:40 AM   #1
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Newbie bash help with loop


I am uncertain if this will work... I'm new with scripting and have received excellent help here. This is an excerpt of the end of my script.

This part is used to copy my secondary script to the chroot and continue with my setup.
I've pastebin the code if someone would be kind enough to critique

Code:
#THE LOOP DOESN'T SEEM RIGHT BECAUSE THE LOOP WOULD BREAK AFTER THE CHROOT COMMAND IS USED...?
#CHROOT AND CONTINUE  .....    
while [ $CHRT -ne 0 ]
 do
echo "Chrooting into Environment"
echo "Please choose which Arch you installed"
echo 
echo "1- You installed Core2Duo"
echo "2- You installed i686"
echo
echo
read -p "Enter selection (1-2) and press Enter" CHRT  
 case $CHRT in
   1)
      cp $HOME/FAI/script_x64 /mnt/funtoo       #I'D LIKE TO ECHO USERS PATH TO PREVENT HAVING TO USE AN ABSOLUTE PATH TO COPY TO PREVENT ERROR
      chroot /mnt/funtoo script_x64             #IS THIS THE RIGHT COMMAND TO EXECUTE THE CHROOTED SCRIPT...?
    break;;
   
   2)
      cp $HOME/FAI/script_x86 /mnt/funtoo
      chroot /mnt/funtoo script_x86
    break;;

   *)
      echo
      echo "Not a valid selection, please try again!"
      echo ;;
  esac
done
#THIS WILL CONTINUE ONTO THE NEXT SCRIPT THAT I HAVE COPIED TO THE CHROOTED PARTITION

Last edited by manwithaplan; 02-24-2009 at 03:52 AM.
 
  


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
how to loop over text file lines within bash script for loop? johnpaulodonnell Linux - Newbie 9 07-28-2015 04:49 PM
bash loop within a loop for mysql ops br8kwall Programming 10 04-30-2008 04:50 AM
BASH - while loop snorkytheweasel Linux - Desktop 2 03-26-2008 10:36 PM
Bash for loop Genjix Programming 5 12-23-2004 03:56 AM
bash for loop problem deadlock Programming 5 09-04-2003 05:32 AM


All times are GMT -5. The time now is 10:16 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