- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to loop 4 different scripts in one script ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015 06:00 AM - last edited on 03-11-2015 06:53 PM by Maiko-I
03-11-2015 06:00 AM - last edited on 03-11-2015 06:53 PM by Maiko-I
How to loop 4 different scripts in one script step by step
Hello expert ,
I have made 4 scripts & i want to run those scipts in a single hit ,which will give me the succelssfull complition message & will ask me just to hit the no like hit 1 to execute script 1 etc ..a switch though ,therefore i am not that much aware or good in scripting.here i am attaching the scripts for your ready reference according to order .request yo to please help me out.
PFA scripts ...
P.S. This thread has been moved from HP-UX > System Administration to HP-UX > languages. - Hp Forum Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015 06:17 AM
03-11-2015 06:17 AM
Re: How to loop 4 different scripts in one script step by step
If you want to execute the 4 other scripts, you can simply have a command line option to invoke one of them.
If you want a loop with a menu, you can use the select statement to prompt a list of choices.
You can then read the result and then execute one of the scripts.
select identifier [in word...]; do list done
select result in script1 script2 script3 script4; do
if [ "$result" = "" ]; then
echo "Bad input: $REPLY"
else
echo "$result: $REPLY"
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015 06:27 AM
03-11-2015 06:27 AM
Re: How to loop 4 different scripts in one script step by step
Thanks Dennis,
However will you please just let you know for 1 or 2 scripts so that i can perform the rest of the scripts.
There are 12 scripts though that i made.
Please help me out.
Thanks & regards,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015 01:11 PM
03-11-2015 01:11 PM
Re: How to loop 4 different scripts in one script step by step
Can you just show you one example ..so that i can start with somewhere ....
Thanks,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015 11:34 PM
03-11-2015 11:34 PM
Re: How to loop 4 different scripts in one script step by step
>Can you just show you one example?
select result in lmrk_base_dirs script2 script3 script4 exit; do
if [ "$result" = "" ]; then
echo "Bad input: $REPLY"
else
echo "$result: $REPLY"
case $result in
lmrk_base_dirs) lmrk_base_dirs.sh
;;
script2) execute_script_2
;;
script3) execute_script_3
;;
script4) execute_script_4
;;
exit) exit
;;
*) echo "Mismatch with select and case" 1>&2
exit 1
;;
esac
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2015 05:37 AM
03-13-2015 05:37 AM
Re: How to loop 4 different scripts in one script step by step
Hello Dennis,
Thanks a ton for thsi help .However, do i need to speecify the path of the script location.
I am really new to scripting ,please guide me to resolve this.
Thanks,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2015 03:36 PM - edited 03-13-2015 03:37 PM
03-13-2015 03:36 PM - edited 03-13-2015 03:37 PM
Re: How to loop 4 different scripts in one script step by step
>do I need to specify the path of the script location?
If these scripts are in your $PATH, then no.
Otherwise you can use absolute paths.
Or you can augment $PATH in your script:
PATH=new-path:$PATH