RSS Forums RSS
Please support our Shell Scripting advertiser: Programming Forums
Views: 3723 | Replies: 0 | Thread Tools  Display Modes
Reply
Join Date: Oct 2004
Posts: 57
Reputation: satimis is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
satimis satimis is offline Offline
Junior Poster in Training

A simple script to execute a command package

  #1  
Aug 9th, 2005
Hi folks,

I'm prepared to write a simple script to execute 20+ commands and could not figure out how to make use of "loop" subject to certain conditions.

If without conditions
#!/bin/bash

cmd1="code1" #the exact/full command
cmd2="code2" #the exact/full command
cmd3="code3" #the exact/full command
etc.

     cmd1 || exit 1
     cmd2 || exit 2
     cmd3 || exit 3
     ...
     cmdn || exit n
     echo "Build environment entered!"
exit 0

It will be a long script. Please advise how to apply "loop" to shorter the script executing all command subject to following conditions

1) All commands except cmd3 should have no output. If there is any it needs to confirm either to continue OR to exit the shell

2) cmd3 should have "/mnt/lfs" output. If no output OR empty output the shell should exit, not continue executing further commands

TIA

satimis
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:30 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC