Can we execute series of commands from a single script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can we execute series of commands from a single script?
# 1  
Old 03-12-2008
Question Can we execute series of commands from a single script?

Hi,

I am trying to call a certain command from within a shell script, but everytime it executes the script, only the first command runs and it comes out of the control, how do i do it?
code :
````````

#!/bin/sh
#
#
#i=1
#while [ $i -le 3 ]
#do
# i=`expr $i + 1`
#done

StoreXML -project xnat -l work/sample1.xml -u admin -p admin -allowDataDeletion true
StoreXML -project xnat -l work/samnew.xml -u admin -p admin -allowDataDeletion true
StoreXML -project xnat -l work/sample.xml -u admin -p admin -allowDataDeletion true
StoreXML -project xnat -l work/latest.xml -u admin -p admin -allowDataDeletion true

#StoreXML -project xnat -l work/*.xml -u admin -p admin -allowDataDeletion true

While the control comes to the first storexml, it stores the data and exits and doesn't executes the 2nd store xml command.

also, note the last line in the code...I tried storing all the xml files at once, but this too didn't work..
It stores the first xml file and exits.
what's d soln to this..ne type of help is highly appreciated
# 2  
Old 03-12-2008
You can invoke as many commands from a single script.

Is StoreXML another script ?

Try debugging the script. Do the following and then run your script.
Code:
set -x
./yourscript
set +x

# 3  
Old 03-12-2008
Thank you..It worked fine for me..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute commands on remote server using expect script?

I need to copy python script file to around 100 servers using expect script. 1. Copy script to my user home first(/home/myhome) on each remote server 2. change permissions on copied file to 766. 3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Discussion started by: kchinnam
1 Replies

2. Shell Programming and Scripting

How to execute application commands with shell script?

Hi Friends, We have a application "getstatus" which needs to run on application prompt. But it is not working with shell script. Example: Unix Root Prompt# execute "crp" to go to application prompt CRP>getstatus displays output of app health CRP>exit Unix Root Prompt# Script , which... (2 Replies)
Discussion started by: suresh3566
2 Replies

3. Shell Programming and Scripting

Execute script in series of folders

I'm trying to get a script to iterate of an array in bash run a series of commands in those folders. #Folder names folders=(folder1 folder2 folder3) #Common path for folders fold_path="/Users/Rich/Projects/" # For each element array copy script to folder and execute for f in... (2 Replies)
Discussion started by: 3therk1ll
2 Replies

4. UNIX for Dummies Questions & Answers

commands to execute unix script

commands to execute unix script (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

5. Shell Programming and Scripting

Execute ssh commands through bash script

Hi all! I am trying to write a script that will check if a certain directory is available at several different nodes and then do stuff in it ..... On the beginning of the script I give as a variable the directory and the number of the nodes and then I loop like this: for... (3 Replies)
Discussion started by: idet2
3 Replies

6. Shell Programming and Scripting

Execute commands from script in current bash session

I have a file as follows: cat /etc/mxg/ssh-hostsmx.example1.com.au:2225 mx2.example2.com.au:2225 mx.example3.com.au:2225 mail.example4.com.au:2225 mail.example5.org.au:2225 mail.example6.com.au:2225I want to dynamically create aliases for quick access to these servers from bash. I wrote... (4 Replies)
Discussion started by: jelloir
4 Replies

7. Shell Programming and Scripting

Is there a way to make bash [or another shell] use all CPU cores to execute a single script?

I wrote a very simple script that matches combinations of alphabetic characters (1-5). I want to use it to test CPU speeds of different hardware/platforms. The problem is that on multi-core/processor systems, only one CPU is being utilized to execute the script. Is there a way to change that?... (16 Replies)
Discussion started by: ph0enix
16 Replies

8. Shell Programming and Scripting

How can i write a script to execute commands on the webserver from a browser?

I want to create a script with the php exec() or system() function to execute commands from a remote browser on the webserver. I am open to using Perl or whatever. I am using an Apache2 webserver on Ubuntu. I have done quite a bit of research on this on google and read lots of responses about... (0 Replies)
Discussion started by: bash_in_my_head
0 Replies

9. Shell Programming and Scripting

how do i get my script to execute multiple commands?

New to shell scripting. I can't get my script to execute multiple commands. Here's the code. It's a menu script. #!/bin/ksh clear print "SDE MENU" PS3="SDE MENU, enter choice:" select clean_menu in "tasdedev instance 5151" "orkindev instance 5155" "tasdetst instance 5157" "orkinsys... (1 Reply)
Discussion started by: hvincent
1 Replies

10. Shell Programming and Scripting

how to execute shell commands in awk script?

Greetings Friends, Suppose I wish to invoke some shell level commands inside an awk script how to do that? say I wish to use : "wc" on a record to count number of characters in a record Any clues? Thanks, Rishi (1 Reply)
Discussion started by: RishiPahuja
1 Replies
Login or Register to Ask a Question