Xargs -P command execution status

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Xargs -P command execution status
# 1  
Old 02-12-2018
Xargs -P command execution status

Hi,

I am working on a file copier utility where I have written the copy commands to a batch file e.g. file_copier.bat which i pass to xargs command as follows.

Code:
cat file_copier.bat | xargs -n 1 -P 40

I also want to record the copy command status of each file/command in the form "command failed", in case of file not found also I want to record the stderr to a file.
# 2  
Old 02-12-2018
That's a useless use of cat, you can do < file_coper.bat xargs -n 1 -P 40 shorter, faster, and just as readable.

Anyway, xargs does not seem to have the features you want. You can probably do it in shell, once we find out what you're doing. What are the contents of file_copier.bat ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX Sqlplus - Capture the sql statement about to run and execution status

Greetings Experts, I am on AIX using ksh. Created a unix script which generates the CREATE OR REPLACE VIEW ... and GRANT .. statements, which are placed in a single .txt file. Now I need to execute the contents in the file (there are around 300 view creation and grant statements) in Oracle and... (4 Replies)
Discussion started by: chill3chee
4 Replies

2. Shell Programming and Scripting

need help with xargs command..

ls -lrt | awk '$7==12{print $9}' | xargs -i mv {} $dir i executed this command but $dir does not exists....... and the files hv been moved but i dont know where ..... plz help(ASAP) thanks in advance. (8 Replies)
Discussion started by: guptam
8 Replies

3. Shell Programming and Scripting

xargs command

Hi The command below does not work. what I am doing wrong ? For some reason second part of the xargs command is not does what I expect If I get this working I intend to use it for multiple file rename later. echo archDP105144_1_702159963.dbf|xargs -i cp {} `echo {}|awk... (11 Replies)
Discussion started by: zam
11 Replies

4. Shell Programming and Scripting

xargs command problem

Hi I am trying to use "xargs" command to loop through each file, modify it and overwrite the old file with the modification but with the same file name. I thought it is easy but I just can't get it to work I tried the following I thought {} would give me the current file name, but it... (1 Reply)
Discussion started by: tiger66
1 Replies

5. Shell Programming and Scripting

perl - understand process status and continue the code execution

Hello, I need advice on how to check if started processes are finished in perl, here's explanation : OS is RHEL 4, perl -v = "This is perl, v5.8.0 built for i386-linux-thread-multi" The logic of the script : #!/usr/bin/perl use warnings; $param1 = $ARGV; $param2 = $ARGV; $param3 =... (2 Replies)
Discussion started by: sysgate
2 Replies

6. Shell Programming and Scripting

execution status of gotoURL in Win32::IEAutomation

Hi, I am using Win32::IEAutomation module to automate my Web based application. I am trying to prepare a report for the test cases I automated. The problem is I am unable to get the execution status of the commands gotoURL, getButton .... to know if my button click or url redirection is... (2 Replies)
Discussion started by: gurukottur
2 Replies

7. UNIX for Advanced & Expert Users

diff between xargs ls ans ls execution

hi, could any one tell me what is diff between #ls and #xrgs ls (1 Reply)
Discussion started by: useless79
1 Replies

8. Shell Programming and Scripting

Capturing last command execution status in a script.

How to capture output or numeric part given by $? command into the variable? If I go for var=`$?` then $var is found empty. (2 Replies)
Discussion started by: videsh77
2 Replies

9. Shell Programming and Scripting

Status code of last command execution

Hello people, I am using KSH and inside my script I do a cksum and check the status code to see whether the command sucessfully. Here even though the cksum fails due to file not existing the status returned is still 0 because the awk command worked fine. How do I capture just the status of the... (1 Reply)
Discussion started by: tipsy
1 Replies

10. UNIX for Dummies Questions & Answers

use of xargs command

Hi Everybody, Can you explain the difference between the following commands: 1. find . -print|xargs grep -i dba_2pc_pending 2. find . -print|grep -i dba_2pc_pending (5 Replies)
Discussion started by: kishorebabu
5 Replies
Login or Register to Ask a Question