Execute output lines


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execute output lines
# 1  
Old 03-12-2009
Execute output lines

I have a command (not shell script) that general several lines of output like this...
scp /var/lib/mysql/jitu/email.* root@172.29.0.218:/root/pitu/
scp /var/lib/mysql/jitu/orders.* root@172.29.0.218:/root/pitu/

I tried adding xargs but it did not work. -exec was not tried because I guess it is used with find
| xargs -I '{}'
How do I make execute these lines without taking help of shell script?

Regards,
Shantanu Oak
# 2  
Old 03-12-2009
Try eval maybe or show the complete thing you've tried with xargs.
# 3  
Old 03-12-2009
for file in `my command goes here`; do scp $file root@172.29.0.218:/root/pitu ; done > /root/shantanu/copytable.txt 2>&1

This is working as expected. Is it ok to use this?
# 4  
Old 03-12-2009
Yes, that's absolut ok.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute python file, FTP output to another server

Greetings all, We are implementing a new tool called URLwatch which is a python utility. Here are the requirements. 1) Run every 10 seconds 2) Execute the python script 3) Output file gets generated, FTP it to a differernt server I gave no idea how to do this and management needs a demo... (3 Replies)
Discussion started by: jeffs42885
3 Replies

2. Shell Programming and Scripting

How to execute standard output ?

Alright so i got this script genpipe: echo "$*" |sh genscript file vi file << 'HERE' :%s/^/echo /g :%s/ $//g :%s/ /&\| xargs \.\/plus /g :wq HERE cat file Which generates output like echo 1 | xargs ./plus 2 | xargs ./plus 3 and so on Now i got the next script multiplus, who should... (3 Replies)
Discussion started by: Bertieboy7
3 Replies

3. Shell Programming and Scripting

Execute the Output Lines.

Hi, My Script looks like this #! /bin/ksh cd /usr/SrcFiles/ADD; while read line do d=`echo $line|cut -d'.' -f1` echo $d".XML" >> XML_File_List.txt out=`echo "gunzip -c -S .ZIP $d.ZIP > $d.XML;"` echo $out per=`echo "chmod ugo+rwx $d.XML;"` echo $per done <ZIP_File_List.txt and the... (5 Replies)
Discussion started by: naveen.kuppili
5 Replies

4. Shell Programming and Scripting

Execute command created from sql output

Hi, I've would like to create kill statement from sqlplus output. So, I've modified somoene's script : mud_kill_stmt=`sqlplus -s / as sysdba <<EOF select 'kill -9 ' || p.SPID || ';' statement from $process_view p, $session_ ......... and so on exit; EOF` $mud_kill_stmt | tr ... (1 Reply)
Discussion started by: Arkadiusz Masny
1 Replies

5. Shell Programming and Scripting

Compare lines and execute

Greetings, I'm new to scripting and need a little help. I have a NAS server and want to make a script that bans IP if they fail login several times. The problem is that I dont know how to compare the IP's in the file. If they exist more than 3 times do .... #!/bin/sh set -x X=4 rm... (2 Replies)
Discussion started by: ntenz
2 Replies

6. Shell Programming and Scripting

How to execute the rest of the code after commenting multiple lines?

Hi, As I have seen in this forum how to comment multiple lines in the script, but it does not work properly for me. It is blocking the code but it does not execute the rest of the codes. This is my code #! /usr/bin/ksh month='date +"m%"' : << Comments Block if || then echo "inc =... (12 Replies)
Discussion started by: Yamini Thoppen
12 Replies

7. Shell Programming and Scripting

Execute the Output

I am developing a shell script to dynamically generate the DMLs (for hundreds of SQL/Tables) using the gendml command. I want to pass the output of this program(gen_dml.ksh) to a shell and execute it. Can yo give some inputs? #!/bin/ksh #Program name :=gen_dml.ksh echo m_db gendml oracle.dbc... (2 Replies)
Discussion started by: kousikan
2 Replies

8. Shell Programming and Scripting

Execute the output of one liner print

Hello I wrote simple one liner that take RunTime *.exe and link them to the output of the compilation output: find ~/DevEnv/. -name "*.exe" | xargs ls -l | awk '{ x=split($9,a,"/"); print "ln -s " $9 " "a}' and it gives me the desire output , but how can I execute this ln command on every... (1 Reply)
Discussion started by: umen
1 Replies

9. UNIX for Dummies Questions & Answers

output and execute

hi, does this mean that the output will go to a file named $3 with an x in the end, and then it will be executed? grep $1 filename > $3x chmod a+x $3x $3x thanks (2 Replies)
Discussion started by: gammaman
2 Replies

10. Shell Programming and Scripting

How can I get an if statement to execute based on number of lines in a file?

I need to have an if statement in a script to run if there are certain processes running. Easiest way I can see to do this is to run a ps and grep the results based on what I am looking for: $ ps -ef | grep wtrs --- webtrend 5046 1 0 May 12 ? 0:28 /webtrends/versions/6.1/wtrs_ui... (6 Replies)
Discussion started by: LordJezo
6 Replies
Login or Register to Ask a Question