- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help
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
Forums
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
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
04-15-2004 06:03 PM
04-15-2004 06:03 PM
I want to have a script. The funtion of this script is to check a list of database names from a text file and then execute another 3 numbers scripts(available with me) for each of the names.
Text file:
DB1
DB2
DB3
DB4
etc...
My new script should read DB1 first and then execute about 3 more scripts.
Then it reads DB2 and execute the same three scripts and so on till the last DB.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:09 PM
04-15-2004 06:09 PM
Re: script help
create a text file named testfile
then this piece of code will do:
###BEGIN SCRIPT
for i in `cat testfile`
do
/myscript1 $i #Execute Script1
/myscript2 $i #Execute Script2
/myscript3 $i #Execute Script3
done
###END SCRIPT
Here i am passing the values as parameters to the script.
Hope this helps
vj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:16 PM
04-15-2004 06:16 PM
Re: script help
Lets be more specific:
Text filename is testfile.
Contents of the file is
DB1
DB2
DB3
etc...
My three scripts are :
/home/oracle/scripts/a.sh
/home/oracle/scripts/b.sh
/home/oracle/scripts/c.sh
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:22 PM
04-15-2004 06:22 PM
Re: script help
$ cat testfile
DB1
DB2
DB3
...
$
Then the script is mine.sh
$ cat mine.sh
###BEGIN SCRIPT
for i in `cat testfile`
do
/home/oracle/scripts/a.sh
/home/oracle/scripts/b.sh
/home/oracle/scripts/c.sh
done
###END SCRIPT
$
$ ksh mine.sh
it will do what you want
Hope this helps
Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:24 PM
04-15-2004 06:24 PM
Re: script help
Generally, you may need this value inside the script.
Can u please tell what are you going to do with Db1,Db2 etc , inside the script.
Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:34 PM
04-15-2004 06:34 PM
Re: script help
This below script should help you.
for DBASE in `cat testfile`
do
case $DBASE in
DB1) /home/oracle/scripts/a.sh ;;
DB2) /home/oracle/scripts/b.sh ;;
DB3) /home/oracle/scripts/c.sh ;;
esac
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:40 PM
04-15-2004 06:40 PM
Re: script help
Yes. Maybe I wat not clear.
I want the tree script to run on DB1 and then on DB2 and so on..
What should we need to change on your given script to incorporate this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:41 PM
04-15-2004 06:41 PM
Re: script help
The earlier one was for a single script . but the below one for multiple scripts.
for DBASE in `cat testfile`
do
case $DBASE in
DB1) /home/oracle/scripts/a.sh; /home/oracle/scripts/b.sh; /home/oracle/scripts/c.sh ;;
DB2) .................;;
DB3) .................;;
esac
done
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:46 PM
04-15-2004 06:46 PM
Re: script help
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2004 06:52 PM
04-15-2004 06:52 PM
Re: script help
I will get back after testing it.
Thank you all.