02-03-2010
Yes, ever tried to run GNU xargs on a non-Linux system? Last time I tried I had quite some dependencies to pull in too. Sometimes it's not available in binary form, so you'll have to compile it from source (including everything else in the findutils package), suddenly realizing that GNU code relies heavily on GNU libc. My code only needs a compiler (any standard C compiler will suffice) and a C library (again, any will suffice as long as POSIX is supported).
Also, in contrast to xargs, you're allowed to run more than 1 command in parallel. You could, for example, create gzip, bzip2, and LZMA compressed archives at the same time. Try that with xargs alone.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I wish to run parallel process forked from one script.
Currently I doing is submit them in background.
For example:
---------------------------------------------------------------
#!/usr/bin/ksh
process1 &
process2 &
process3 &
.....
.....
#here I check for completion of... (4 Replies)
Discussion started by: RishiPahuja
4 Replies
2. AIX
Hi,
Is there any way to run parallel jobs using make command?
I am using non-GNU make utility on AIX 4.3.
I want to run 2 jobs symultaneously using make utility.
Thanks.
Suman (0 Replies)
Discussion started by: suman_jakkula
0 Replies
3. High Performance Computing
Hi All,
I am working on a project where I need to execute set of arguments (around 500) on a Simulator. If I execute this on one linux (RedHat 8.0) machine it will approximately takes 2~3 days. Since I am having more linux machines am thinking of executing these on different machines in... (7 Replies)
Discussion started by: 123an
7 Replies
4. Shell Programming and Scripting
Hi All,
At present I am using a UNIX Script which is running a set of JOBS. These JOBS are to be repeated for 20 times, means the same set of JOBS are repeated by just passing different arguments (From 1 to 20).
Is there any way by which I can execute them parallel?
At present its all... (4 Replies)
Discussion started by: Prashantckc
4 Replies
5. Shell Programming and Scripting
how can i process jobs parallel with conditions below.
Script1.ksh
Script2.ksh
Script3.ksh
Script4.ksh
Script5.ksh
Script6.ksh
Script7.ksh
Script8.ksh
Script9.ksh
Script10.ksh
After successful completion of Script1.ksh I need to run Script7.ksh.
After successful... (4 Replies)
Discussion started by: ford2020
4 Replies
6. Shell Programming and Scripting
I am haveing 2 scripts, 1st script calls 2ed script for each parameter.(parameters are kept in a different txt file)
1st script
for x in `cat Export_Tables_List.txt`
do
sh Exp_Table.sh $x &
done
echo -e "1) following tables are successfully exported : \n" > temp
cat... (1 Reply)
Discussion started by: sbmk_design
1 Replies
7. Shell Programming and Scripting
Hi,
I am using Ubuntu 10.04 LTS 32-bit. I would like to execute a command in two or more servers (multiple remote hosts) in parallel. The commands "shmux" or "on" are not available in Ubuntu. Could anyone tell me what other equivalent commands available in Ubuntu to accomplish this task? (1 Reply)
Discussion started by: royalibrahim
1 Replies
8. UNIX for Advanced & Expert Users
Hi All,
We have a table that has to store around 80-100 million records. The table is partitioned by a column called Market Code. There are 30 partitions each corresponding to one MRKT_CD.
The source of this table is a join between 3-4 other tables. We are loading this table through SQLPLUS... (2 Replies)
Discussion started by: jerome_rajan
2 Replies
9. Shell Programming and Scripting
I have few very huge files ~ 2 Billion rows of 130 column(CDR data) in a folder, I have written shell script need to read on each file in a folder and will create a new files based on some logic.
But problem is it's taking time to create a new file due to the size , So i dont want to corrupt... (6 Replies)
Discussion started by: rspwilliam
6 Replies
XARGS(1L) XARGS(1L)
NAME
xargs - build and execute command lines from standard input
SYNOPSIS
xargs [-0prtx] [-e[eof-str]] [-i[replace-str]] [-l[max-lines]] [-n max-args] [-s max-chars] [-P max-procs] [--null] [--eof[=eof-str]]
[--replace[=replace-str]] [--max-lines[=max-lines]] [--interactive] [--max-chars=max-chars] [--verbose] [--exit] [--max-procs=max-procs]
[--max-args=max-args] [--no-run-if-empty] [--version] [--help] [command [initial-arguments]]
DESCRIPTION
This manual page documents the GNU version of xargs. xargs reads arguments from the standard input, delimited by blanks (which can be pro-
tected with double or single quotes or a backslash) or newlines, and executes the command (default is /bin/echo) one or more times with any
initial-arguments followed by arguments read from standard input. Blank lines on the standard input are ignored.
xargs exits with the following status:
0 if it succeeds
123 if any invocation of the command exited with status 1-125
124 if the command exited with status 255
125 if the command is killed by a signal
126 if the command cannot be run
127 if the command is not found
1 if some other error occurred.
OPTIONS
--null, -0
Input filenames are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string, which is treated like any other argument. Useful when arguments
might contain white space, quote marks, or backslashes. The GNU find -print0 option produces input suitable for this mode.
--eof[=eof-str], -e[eof-str]
Set the end of file string to eof-str. If the end of file string occurs as a line of input, the rest of the input is ignored. If
eof-str is omitted, there is no end of file string. If this option is not given, the end of file string defaults to "_".
--help Print a summary of the options to xargs and exit.
--replace[=replace-str], -i[replace-str]
Replace occurences of replace-str in the initial arguments with names read from standard input. Also, unquoted blanks do not termi-
nate arguments. If replace-str is omitted, it defaults to "{}" (like for `find -exec'). Implies -x and -l 1.
--max-lines[=max-lines], -l[max-lines]
Use at most max-lines nonblank input lines per command line; max-lines defaults to 1 if omitted. Trailing blanks cause an input
line to be logically continued on the next input line. Implies -x.
--max-args=max-args, -n max-args
Use at most max-args arguments per command line. Fewer than max-args arguments will be used if the size (see the -s option) is
exceeded, unless the -x option is given, in which case xargs will exit.
--interactive, -p
Prompt the user about whether to run each command line and read a line from the terminal. Only run the command line if the response
starts with `y' or `Y'. Implies -t.
--no-run-if-empty, -r
If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no
input.
--max-chars=max-chars, -s max-chars
Use at most max-chars characters per command line, including the command and initial arguments and the terminating nulls at the ends
of the argument strings. The default is as large as possible, up to 20k characters.
--verbose, -t
Print the command line on the standard error output before executing it.
--version
Print the version number of xargs and exit.
--exit, -x
Exit if the size (see the -s option) is exceeded.
--max-procs=max-procs, -P max-procs
Run up to max-procs processes at a time; the default is 1. If max-procs is 0, xargs will run as many processes as possible at a
time. Use the -n option with -P; otherwise chances are that only one exec will be done.
SEE ALSO
find(1L), locate(1L), locatedb(5L), updatedb(1) Finding Files (on-line in Info, or printed)
XARGS(1L)