Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Aug 8th, 2005, 10:28 PM   #1
satimis
Newbie
 
Join Date: Oct 2004
Posts: 17
Rep Power: 0 satimis is on a distinguished road
A simple script to execute a command package

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
satimis is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC