Sponsored Content
Full Discussion: Append and redirect
Top Forums UNIX for Dummies Questions & Answers Append and redirect Post 3590 by Anna on Friday 6th of July 2001 04:21:36 PM
Old 07-06-2001
Append and redirect

Can somebody please explain to me what redirection (>) and append are? What is the difference between > and >>?

Thank-you
 

10 More Discussions You Might Find Interesting

1. IP Networking

Redirect

I'm sittig behind a firewall that doesn't allow ftp. I have a conection to a UNIX system, connecting throug SSH. Is it possible to redirect the ftp through the UNIX to my computer? (1 Reply)
Discussion started by: <Therapy>
1 Replies

2. UNIX for Dummies Questions & Answers

how do redirect in bind

Hello all! Does anyone know how to redirect i link to a host or alias name? Here is the example: i wank to type "Bob" in my browser and be redirected to http://192.168.54.37:7001/Bob/BobMainServlet on that perticular port. Im using Redhat 6.2 with bind 9.2.3 regards... dOzY (4 Replies)
Discussion started by: dozy
4 Replies

3. Shell Programming and Scripting

Redirect output

Hi all, I have a script which call a java program, the logging (to log file) in the program is done using log4j. However, as a safety measure, i still choose to direct standard error to another log file as follow /usr/bin/java -classpath ${classpath} -Xmx128m TestingProgram 2>>... (1 Reply)
Discussion started by: mpang_
1 Replies

4. UNIX for Dummies Questions & Answers

Sendmail MX redirect

Hi I have a working sendmail setup for my domain, but would like to run a subdomain on another machine. I could try below, but its a production server and worry about messing it up. Hence the question. So I have machine names: mydomain.com (mail server) dev.mydomain.com currently the... (1 Reply)
Discussion started by: gtrava01
1 Replies

5. Shell Programming and Scripting

Redirect Problem

Hi, I have perl script which is calling an external command using "system()" with argument. But i am not able to capture the output.Even tried with backtick also with no luck. . . $number=<>; system ("cmd $number >output.txt"); (2 Replies)
Discussion started by: rasingraj
2 Replies

6. Web Development

URL Redirect

Just want to give a background. Currently, our company web site is redesigned and there are about 200 current URLs will have new redirects. I don't want to enter them in the config file rather would like to have them in a text file/config file and referring the file from the config whenever the... (2 Replies)
Discussion started by: jawak
2 Replies

7. Shell Programming and Scripting

Redirect capitalize

How do i send the output from the date command to a variable called today easy: today=$(date) but how can the output be capitalized on a single command ? (2 Replies)
Discussion started by: JuankyKong
2 Replies

8. Shell Programming and Scripting

Problem with << redirect - Please help!

I have a script to send an email like below. Problem is, the if ..fi block is not getting executed, and is coming as a part of the email body. Can anyone take a look at this? :confused: Log file shows this: SEND_MAIL.prog: line 64: : command not found echo "Input Parameters" echo... (11 Replies)
Discussion started by: mansmaan
11 Replies

9. UNIX for Dummies Questions & Answers

How to append a string by cat and redirect to other file?

Hi, when I do cat for kernel parameters cat /proc/sys/kernel/sem >> /etc/sysctl.conf 4096 4096 32 128 The above command working with out any doubt but I want to pass it like below, need to append "kernel.sem =" and pass it to /etc/sysctl.conf kernel.sem = 4096... (2 Replies)
Discussion started by: stew
2 Replies

10. Shell Programming and Scripting

Ftp redirect

Hi i want to redirect a list of ftp file to an exsisting file by mls x.txt mylocalfile.txt result of this command corrupt my data on mylocalfile.txt , please help me (2 Replies)
Discussion started by: rezasadeghi
2 Replies
xjobs(1)							   User Commands							  xjobs(1)

NAME
xjobs - construct command line and execute jobs in parallel SYNOPSIS
xjobs [options] [utility [argument ...]] DESCRIPTION
xjobs reads job descriptions line by line and executes them in parallel. It limits the number of parallel executing jobs and starts new jobs when jobs finish. Therefore, it combines the arguments from every input line with the utility and arguments given on the command line. If no utility is given as an argument to xjobs, then the first argument on every job line will be used as utility. To execute utility xjobs searches the directories given in the PATH environment variable and uses the first file found in these directories. xjobs is most useful on multiprocessor machines when one needs to execute several time consuming commands that could possibly be run in parallel. With xjobs this can be achieved easily, and it is possible to limit the load of the machine to a useful value. It works similar to xargs, but starts several processes simultaneously and gives only one line of arguments to each utility call. By using I/O redirectors the standard input, output, and error stream of executed jobs can be redirected. Use < to redirect standard input, > to redirect standard output, >! to redirect standard output and overwrite an existing file, >> to append standard output to an existing file, >& to redirect both standard output and standard error output to the same file, and >>& to append both standard output and standard error output to the same file. If passed on the command line, these operators specify the default I/O redirection that can be overwritten by specifying another redirector to a specific job on its argument line. After all these operators a filename is expected. See EXAMPLES below for an example. If you need more advanced shell features than the redirection operators supported by xjobs, then use as utility a shell of your preference. Every job line can be preceeded by a "cd directory;" command that tells xjobs in which directory the job shall be executed. For every line this can only be used once. For more complex scripting, please pass the line to execute to a shell of your choice. xjobs constructs the arguments of the jobs to execute from each input line. Each input line will create a seperate job, whereas newline character are handled as regular whitespace by xargs. To be able to include whitespace charakters in arguments, either preceed them with a backslash or quote them with single or doublequote charakters. A backslash charakter preceeding a newline will make xjobs ignore the new- line character, thus giving you the ability to pass arguments for a single job across multiple lines. To include quotation marks in quoted arguments, preceed them with a backslash. Lines passed to xjobs beginning with a # charakter are interpreted as comments. Finally, xjobs also includes a mechanism for serializing the execution. Like this it is possible to parallelize independent jobs and sequence jobs that have a dependency. This can be achieved by inserting a line that only consists of two percentage charakters in sequence (%%). All jobs before this sequence point are executed at the requested number of jobs in parallel. When hitting the sequence point xjobs waits for all processes to finish and then continues starting jobs that follow the sequence point. When passing a named pipe (i.e. a file name created by mkfifo) via option -s as an input, xjobs will close and reopen the fifo when reach- ing end-of-file. Like this it is possible to setup an xjobs server and sending jobs to this server from muliple programs. See section EXAM- PLES below for an example. OPTIONS
-j <jobs> Sets the maximum number of jobs that are started in parallel. The default value is to limit the number executing jobs is equal to the number of online processors in the system. If the number passed as <jobs> is followed by an 'x' charakter (e.g. 2.5x), the value is multiplied with the number of online processors before setting the job limit. I.e. having a machine with 4 online processors and passing 2.5x as an argument to option -j will yield a joblimit of 10 jobs. -s <script> Use file script instead of the standard input to read the job descriptions. -n Redirect standard output and standard error output of executed jobs to /dev/null. -l <num> Combine the arguments of <num> input lines for a single job. -p Start jobs interactively, prompting the user. -q <num> Limits the number of queued jobs to num elements. Normally xjobs reads in jobs from standard input or the give script and queues them if they cannot be started at once. With this option, xjobs will stop reading as soon as num jobs are queued and restart reading when a new job has been started. Like this xjobs allocates less memory. Use this option, if you pass huge number of jobs to xjobs, to limit memory consumption. It can also increase performance of xjobs, but be sure that jobs get fed fast enough to xjobs. -1 Pass one argument per job, which is expected to be terminated by a new-line character. No argument parsing is performed. That way it is more easy to process jobs where arguments may include whitespace character or other tokens that influence argument parsing. -0 Same as -1, but as a job and argument termination character a null-character () is expected instead of a new-line character. That way also arguments with new-line character can be processed without escape sequences. -V Print the version number of xjobs and exit. -v <level> Set verbosity of xjobs to level. Valid leves are: 0=silent, 1=error, 2=warning, 3=info, 4=debug. The default level of verbosity is 3. EXAMPLES
If you have a lot of .zip files that you want to extract, then use xjobs like this: $ ls -1 *.zip | xjobs unzip If you want to do the same without getting the output of each unzip task on your terminal, then try this: $ ls -1 *.zip | xjobs -n unzip To gzip all *.bak files in a given directory hierarchy, use it the following way: $ find . -name '*.bak' | xjobs gzip To generate index files for a set of *.jar files, you can use the redirection feature of xjobs, and do the following: $ ls -1 *.jar | sed 's/(.*)/1 > 1.idx/' | xjobs jar tf If you also want to capture the error output, than use >& instead of >. You can also use it to execute several different commands. Therefore, write a script file that contains every job you want to execute and pass it to xjobs with the option -s: $ cat - > script unzip my.zip tar xf my.tar lame --silent my.wav my.mp3 crypt notsecret < mydata > secretfile ^D $ xjobs -s script To be able to queue up jobs from multiple sources with xjobs, use a named pipe and pass it explicitly as input script. Then write the jobs to the named pipe: $ mkfifo /var/run/my_named_pipe $ xjobs -s /var/run/my_named_pipe & $ echo unzip 1.zip >> /var/run/my_named_pipe $ echo tar cf /backup/myhome.tar /home/me >> /var/run/my_named_pipe ENVIRONMENT VARIABLES
PATH Determines the location of command. AUTHORS
Thomas Maier-Komor <thomas@maier-komor.de> Donations via PayPal are welcome! HOMEPAGE
http://www.maier-komor.de/xjobs.html LICENSE
GNU General Public License Version 2 SEE ALSO
xargs(1) Thomas Maier-Komor 20100915 xjobs(1)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy