running multiple command in a single line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting running multiple command in a single line
# 1  
Old 03-29-2012
running multiple command in a single line

Hi

Can we run the linux command and per script in a single command

Code:
[/efare1/home/qabuild] $ cd /usr/local/adm/ ;ctsv scmtest_qabuild ;cspec.pl scmtest

This is a combination of linux and clearcase command and last one is perl script with argument.
I can see the first and 2nd coomand is executing but last i.e. perl script is not running.

Please suggest.
# 2  
Old 03-29-2012
You have to run perl script as
Code:
[/efare1/home/qabuild] $ cd /usr/local/adm/ ;ctsv scmtest_qabuild ;perl cspec.pl scmtest

--Shirish
# 3  
Old 03-29-2012
No its not running this way I tried it but no luck
# 4  
Old 03-29-2012
does it run separately . if its running then whats the error that you are getting during combined run ??
# 5  
Old 03-29-2012
yes it run separately fine but when I try it with multiple coomands it does not provide the same result.this perl script actually set the configuration of any branch.

for e.g
Code:
element * CHECKEDOUT
element * .../apr0512-dev/LATEST
element * APR0512-BASE -mkbranch apr0512-dev
element * .../pub-int/0 -mkbranch apr0512-dev
element * /main/0 -mkbranch pub-int

for which brnach I am trying
Code:
element * CHECKEDOUT
element * SCMTEST-BASE -mkbranch scmtest-dev
element * .../pub-int/0 -mkbranch scmtest-dev
element * /main/0 -mkbranch pub-int

That it is showing 4 lines whereas after setting it it should show 5 lines

Last edited by Franklin52; 03-29-2012 at 09:41 AM.. Reason: fixed code tags
# 6  
Old 03-29-2012
try #!/bin/perl in the 1st line of script.
# 7  
Old 03-29-2012
This is alreay mentioned in the sript
Code:
[/usr/local/adm] $ less cspec.pl
#! /usr/atria/bin/Perl

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

2. Shell Programming and Scripting

convert single line output to multiple line

Hi all, I have a single line output like below echo $ips 10.26.208.28 10.26.208.26 10.26.208.27 want to convert above single line output as below format. Pls advice how to do ? 10.26.208.28 10.26.208.26 10.26.208.27 Regards Kannan (6 Replies)
Discussion started by: kamauv234
6 Replies

3. UNIX for Dummies Questions & Answers

How to run multiple command in a single line?

Normally i would do this- cd abc ls -ltr I wish to run above command in a single line, like this- cd abc | ls -ltr But above command doesn't works, it simply runs the second command, ignoring the 1st one. :confused: (4 Replies)
Discussion started by: boy18nj
4 Replies

4. Shell Programming and Scripting

Running Two scripts in a single command line

Hi All, I have two scripts which i want to run in a single command line(or in a single script). And if both the scripts in the main script fail then i want to pass a value to a Application specific utility which will trigger some alert.The value can be anything. Somebody please help.It is... (1 Reply)
Discussion started by: shroh
1 Replies

5. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

6. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

7. Shell Programming and Scripting

Running multiple unix commands in a single script

Hi, I would like to write a script with include more than 6 unix commands. my script like below: echo " script started" ls -ld bdf | grep "rama" tail -10 log.txt ... .. ... now, i want to run above unix commands one by one. example: first the ls -ld command will be... (3 Replies)
Discussion started by: koti_rama
3 Replies

8. Shell Programming and Scripting

running multiple command in same line

I have 5 hosts and each host as 3 java process .I have one machine which has ssh keys so it can login without any passwords etc to all the machines. How can I find out say jstack or some command so it goes to each machine and run the command . For example machine 1 has 3 java process and they... (2 Replies)
Discussion started by: gubbu
2 Replies

9. Shell Programming and Scripting

make multiple line containing a pattern into single line

I have the following data file. zz=aa azxc-1234 aa=aa zz=bb azxc-1234 bb=bb zz=cc azxc-1234 cc=cc zz=dd azxc-2345 dd=dd zz=ee azxc-2345 ee=ee zz=ff azxc-3456 ff=ff zz=gg azxc-4567 gg=gg zz=hh azxc-4567 hh=hh zz=ii azxc-4567 ii=ii I want to make 2nd field pattern matching multiple lines... (13 Replies)
Discussion started by: VTAWKVT
13 Replies

10. Shell Programming and Scripting

single line input to multiple line output with sed

hey gents, I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Discussion started by: mitch
8 Replies
Login or Register to Ask a Question