Executing several bash scripts in succession


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing several bash scripts in succession
# 1  
Old 05-16-2009
Executing several bash scripts in succession

Hi,

I am new to shell programming. I am trying to automate setting up a network using several scripts. Some of the scripts require to reboot in order to continue with the setup. Is it possible to enter another script as soon as the system reboots. Also, if the last line of the script is bash "anotherscript.sh" will "anotherscript.sh" start up ?

Thanks in advance.
# 2  
Old 05-16-2009
Hi, on which operation system do you want to run the script?
# 3  
Old 05-16-2009
Hi research3,

I am running the script on Ubuntu.
# 4  
Old 05-16-2009
Hi, do you want to start a secondary.sh script from you fist.sh script or to assign all the variables in the secondary.sh script?
# 5  
Old 05-16-2009
Hi,

I want to start a new script (execute a new bash file).
# 6  
Old 05-16-2009
if you want to start a bash script between you pc reboot than you have to create or to move it in the right folder.
For Ubuntu is that
/etc/rc0.d/

you can also create it in your home directory an then create in the directory /etc/rc0.d/ a symbolic link


cd /home/user
touch bash.sh
cd /etc/rc0.d/
ln -s S01backup /home/user/bash.sh

I guess that's all!
# 7  
Old 05-16-2009
Hi research3,

Thanks so much. But I dont understand it completely.

Suppose I have 2 scripts "1.sh" and "2.sh" and "1.sh" needs to restart then I should place "2.sh" in /etc/rc0.d/ .... Am I correct? .... and the last line in "1.sh" needs to be "bash 2.sh" ?

Thanks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using a script to define variables and run multiple other scripts in succession.

I'm pretty new to scripting in Korn shell so please forgive me... What I'm trying to do is to create a script that calls multiple other ksh scripts and defines variables for text files. I need it to define my user defined variables (file paths, date & time stamps, etc that are currently in... (1 Reply)
Discussion started by: bluejwxn8
1 Replies

2. Shell Programming and Scripting

Executing scripts on remote servers

Hello all, I'm typing away a script that will send a script to a remote host and execute it. This is what i have at the moment and i was wondering if i can improve that or thats basicly what everybody does. Using bash on RHEL 5.5 To over simplify it... #!/bin/bash # start_ () { ... (3 Replies)
Discussion started by: maverick72
3 Replies

3. Shell Programming and Scripting

Default shell for executing scripts

Hi there, And happy new year to everyone. I was wondering how is set the default shell for executing scripts. I mean when the first line of a script file is not #!/bin/bashThen what shell will be used to execute the script? I thought the script file would be parsed using the current shell... (6 Replies)
Discussion started by: chebarbudo
6 Replies

4. Shell Programming and Scripting

Executing all scripts in /DIR except one

First i need to find all scripts directly under /DIR that end with ".sh" extension except "noallow.sh". That can be done with: find /DIR -maxdepth 1 -name "*.sh"|grep -v "noallow.sh" Now i want to run all the files output from the previous command. The following code: for filename in... (6 Replies)
Discussion started by: proactiveaditya
6 Replies

5. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

6. Shell Programming and Scripting

executing shell scripts in a browser

Hi all Im a newbie in shell scripting, i found it joyous creating simple adminitrative scripts, like adding users, modify and delete, remote sw install etc, now i want to intergrate my scripts to make a simple administrative tool, how do i access the scripts via a browser is it possible?? ... (2 Replies)
Discussion started by: jefinah
2 Replies

7. Shell Programming and Scripting

Executing scripts in Parallel

Hi All, I have 3 shell scripts, Script1,Script2 and Script3. Now I want to run Script1 and Script2 in parallel and Script3 should depend on successful completion of both Script1 and Script2. Could you please suggest an approach of acheiving this... Thanks in advance (2 Replies)
Discussion started by: itsme_maverick
2 Replies

8. UNIX for Dummies Questions & Answers

Executing Shell Scripts

Hi, I'm pretty new to Unix and I just have a question concerning making a script executable without putting the "sh" command before it. In case it makes the difference I am on an Apple computer using the Terminal. Anyway here is the little test code I wrote followed by the commands I took to try... (1 Reply)
Discussion started by: BuyoCat
1 Replies

9. Shell Programming and Scripting

executing variables in ksh scripts?

In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments. FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc" -or- FINDIT="ps -ef | grep oracle | grep prod | grep runback" I... (3 Replies)
Discussion started by: zedmelon
3 Replies

10. UNIX for Advanced & Expert Users

executing perl scripts

Does anybody experiencing this same problem? I am using IRIX64 ver 6.5 at work. I wrote some Perl scripts and to execute it. First I try to put the Perl script at: /$HOME/bin/perlscript then I set the correct executable 755 right to the file I make sure the PATH to the executable... (2 Replies)
Discussion started by: vtran4270
2 Replies
Login or Register to Ask a Question