Executing all the scritpts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing all the scritpts
# 1  
Old 07-22-2013
Executing all the scritpts

Hi

I've the following shell scripts in a directory
Code:
abc.sh    bcd.sh  cde.sh  def.sh

And all these scripts need to be executed one by one .
What is the way to execute all the scripts in a single command / Script one after the other

Thank You
# 2  
Old 07-22-2013
write them one below another and execute.. or
abc.sh; bcd.sh ; cde.sh ; def.sh
# 3  
Old 07-22-2013
Hi Vidyadhar ,
I'm Usig KSH 88 Version

I tried like below
Code:
#!/bin/ksh    
set -x
Fld_Pth=/etc/home
cd $Fld_Pth
echo "This script is about to run another script."
./abc.sh 
./bcd.sh
echo "This script has just run another script."

And getting the error that
Command not found

please suggest
Thanks
# 4  
Old 07-22-2013
Are the scripts abc.sh and bcd.sh are in the current directory where you are running your original script

And also do they have executable permissions? If not give them appropriate executable permission.
# 5  
Old 07-22-2013
Thanks for the reply Millan,

I've given all the necessary permissions (777) to the scripts ,Folders etc
And all the scripts are in Same directory .
# 6  
Old 07-22-2013
Code:
#!/bin/ksh    
set -x
Fld_Pth=/etc/home
find ${Fld_Pth} -name '*.sh' -type f -perm 777 | sh -x

What about this?
# 7  
Old 07-22-2013
The necessary permission is 755.
How looks the shebang (1st line) in the scripts? Should be #!/bin/ksh or similar.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script not executing

Hi, am facing some problem while inserting a record into a script Please find script below. `sqlplus -s asdf/asdf123 <<eof! set feedback off; set heading off; set verify off; insert into... (3 Replies)
Discussion started by: senkerth
3 Replies

2. UNIX for Dummies Questions & Answers

Script not executing

Hello, I wasn't sure where to post this so I posted it here. I've used UNIX quite a bit, LINUX not so much. For some reason, my LINUX script will not execute if I type in the script name and press enter. I'm in the directory where the script is. test.sh However, when I use ". ./" it... (5 Replies)
Discussion started by: jsanders
5 Replies

3. Shell Programming and Scripting

executing one script from other

Script test #! /bin/csh -f echo checking the sset command if( -e /home/user/project/runtest/testdir/ts ) then echo ts script present set cmd = "/home/user/project/runtest/testdir/ts a 1 b 2 c 3" else echo script not present endif echo $cmd echo done script ts #!/bin/csh -f set... (1 Reply)
Discussion started by: animesharma
1 Replies

4. Programming

No error but not executing

Hi friends When I compile thic program by gcc filename, it shows no error. But after that if I execute the program gets stuck. Can any one find out. #include<stdio.h> #include<sys/types.h> #include<sys/mman.h> #include<stdlib.h> #include<fcntl.h> #include<sys/stat.h>... (6 Replies)
Discussion started by: gokult
6 Replies

5. Programming

No error but not executing

Hi friends NO errors, but when I try to execute the program it gets struck. Can any one find it out. #include<stdio.h> #include<sys/types.h> #include<sys/mman.h> #include<stdlib.h> #include<fcntl.h> #include<sys/stat.h> #include<unistd.h> #include<signal.h> #include<string.h> ... (0 Replies)
Discussion started by: gokult
0 Replies

6. Shell Programming and Scripting

Executing commands

I need to execute a command to run my script several times with varying parameters perl ex.pl -b 130198 -e 130884 -c plot plot.txt 1_plot.txt perl ex.pl -b 1345 -e 1308 -c plot plot.txt 2_plot.txt perl ex.pl -b 1345567 -e 130898 -c plot plot.txt 3_plot.txt . . . 100's of excutions ... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

7. UNIX for Dummies Questions & Answers

cronjob not executing...

Hi All. I created a cronjob entry and for some reason it is not executing. The script that it is suppose to call sends me an email when it is done. When I run the job manually it executes fine. This how my cron entry looks: 00 14 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>$1... (5 Replies)
Discussion started by: shaseeb
5 Replies

8. Shell Programming and Scripting

create a new name while executing

Hi, I need to run an executable with a different name. say there is 1 executable but 100 different instances running ..all with unique names .how do i achieve it since i need to check that i do not bring up more than 1 instance with the same name. for eg hello.out is the executable ..I want to... (0 Replies)
Discussion started by: sujay
0 Replies

9. Shell Programming and Scripting

executing script

Hello ; I have a script myscript.sh. If I type at prompt myscript.sh I will receive ksh: myscript.sh: not found but if I type ./myscript.sh it works . What should I do to be able to run myscript just typing myscript.sh Many thanks before. (1 Reply)
Discussion started by: big123456
1 Replies

10. Shell Programming and Scripting

script not executing

test:/oracle/home $ ex_im1.sh ksh: exp_imp1.sh: not found $echo $SHELL /bin/ksh ex_im1.sh has rwxr--r-- permissions thanks (3 Replies)
Discussion started by: dreams5617
3 Replies
Login or Register to Ask a Question