Sponsored Content
Top Forums Shell Programming and Scripting Command output redirection to file issues Post 302999195 by RudiC on Thursday 15th of June 2017 07:09:48 AM
Old 06-15-2017
OK, let's become serious:

Please become accustomed to provide decent context info of your problem.
It is always helpful to support a request with system info like OS and shell, related environment (variables, options), preferred tools, and adequate (representative) sample input and desired output data and the logics connecting the two, to avoid ambiguities and keep people from guessing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Redirection of output to a log file

Apologies for the trivial nature of this question but I cannot seem to get a simple re direct to a log file to work Step 1 touch log.txt at -f batch.sh now >> log.txt I am trying to get the batch.sh contents into the log file Manny Thanks (8 Replies)
Discussion started by: JohnCrump
8 Replies

2. Shell Programming and Scripting

Remote server file output redirection

Hi, I want ssh to the remote server and then execute ls and redirect the output to the file in remote server itself like ssh root@$server `ls /var/log/users.txt > root@$server:/home/users.txt` Can you please let me know the correct syntax for it. Thanks in advance (2 Replies)
Discussion started by: mohitmoudgil
2 Replies

3. UNIX for Dummies Questions & Answers

Output file redirection

Suppose I have a file named a When I write cat a>a The following error message is displayed cat: a: input file is output file and my file a is truncated to zero size. Also the exit status of the last command is 1 Can someone tell me what actually happens when I do so? (1 Reply)
Discussion started by: aagajaba
1 Replies

4. UNIX for Dummies Questions & Answers

Capping output redirection log file length

I am trying to write a script which will output notifications to a logfile, but I would like to cap the logfile to, let's say, 200 lines. Specifically I am using custom firmware, DD-wrt, on my router and I am implementing a script to connect to my work vpn. I have a loop that pings a computer... (2 Replies)
Discussion started by: joemommasfat
2 Replies

5. Shell Programming and Scripting

awk output redirection to file

I have a system stat command running which generates data after 5 sec or so. I pass this data to awk and do some calculation to present the data differently. Once done now I want to pass this data to file as and when generated but doesn't work..unless the first command completes successfully.... (6 Replies)
Discussion started by: learnscript
6 Replies

6. Shell Programming and Scripting

Help with tar --append command output redirection

I am using tar command to append daily database backups on tape. "tar --append " command help me to do this. But tar --append command does not produce any output on stdout if it succeed. I want the output for that appended command to a log file. This log file should contain only the name of the... (0 Replies)
Discussion started by: pganguly46
0 Replies

7. Shell Programming and Scripting

output redirection to existing file question

So I have a existing file that I used the uniq command on and I need to save the output to the same file without changing the file name. I have tried $ uniq filename > filename then when I cat the file it then becomes blank like there is nothing inside. any help would be much appreciated... (0 Replies)
Discussion started by: drew211
0 Replies

8. UNIX and Linux Applications

output redirection command

Dear All, ./waf --run scratch/myfirst > log.out 2>&1 The above is a command line to redirect the output to a file called log.out. what is the 2>&1 part for ? Thank you (2 Replies)
Discussion started by: knowledgeSeeker
2 Replies

9. Shell Programming and Scripting

Command output redirection in script not working

I need to count the number of lines in a .txt file and put it in a variable. I am using the following code #!/bin/bash count = $(wc -l "some file.txt" | awk '{print$1}') echo $count It is giving the following error. line3: count: command not foundWhat am I doing wrong here? :confused: (7 Replies)
Discussion started by: haritha.gorijav
7 Replies

10. Shell Programming and Scripting

Output redirection of c binary file to a file in shell script is failing

I am struck up with a problem and that is with output redirection. I used all the ways for the redirection of the output of c binary to a file, still it is failing. Here are the different ways which I have used: ./a.out | tee -a /root/tmp.txt 2>&1 ./a.out | tee -a /root/tmp.txt 1>&1 ./a.out |... (2 Replies)
Discussion started by: Maya29988
2 Replies
PEXEC(1)							   User Commands							  PEXEC(1)

NAME
pexec - executing commands in parallel SYNOPSIS
pexec [options] [-c|-m] [--] command [arguments] | 'compound command' DESCRIPTION
Execute commands or shell scripts in parallel on a single host or on remote hosts using a remote shell. OPTIONS
General options: -h, --help Gives general summary about the command line options. --long-help Gives a detailed list of command line options. --version Gives some version information about the program. -s, --shell <shell> Full path (e.g. /bin/sh) of the shell or interpreter to be used for script execution. -c, --shell-command Use the specified shell to interpret the command(s) instead of direct execution. -m, --multiple-command Allow multiple individual shell command scripts to be executed in parallel with the variation of the parameters. -e, --environment <variable> Name of an environmental variable which is set to the respective parameter before each execution. -n, --number <number> The maximal number of processes running simultaneously. The <number> itself can even be a complex specification of remote hosts (see documentation for more details). -C, --control <port> The control port of a hypervisor daemon (full path of a UNIX socket or an INET host specification). -p, --list <list> The single-argument form of main parameter list. -r, --parameters <list> The multiple-argument form of the main parameter list. -f, --listfile <file> The main parameter list file. -w, --column <index> The column index from where the parameters should be taken if they are read from a parameter file. -t, --complete Threat the whole line as a single parameter if the parameters are read from a file. -z, --nice Sets the scheduling priority of pexec and all children (executed processes) to the priority defined by this nice value. -- A marker after which the command to execute begins. Redirecting standard input, output and error: -i, --input <input> The (optionally formatted) name of the input file which is used for redirecting the standard input. -o, --output <output> The (optionally formatted) name of the output file which is used for redirecting the standard output. -u, --error <output> The (optionally formatted) name of the output error file, which is used for redirecting the standard error. -R, --normal-redirection Equivalent to specifying --output -, --error - and --input /dev/null. -a, --output-format <format> The format of the final standard output redirection if the output of all of the processes are gathered into the same file. -b, --error-format <format> The same final redirection format for the standard error. -x, --omit-newlines Disable automatic newlines after the output and error formats. Execution using remote hosts: -g, --remote-shell <remote_shell> The name or full path of the remote shell to be used for building the tunnel between the local and the peer host(s). Default: ``/usr/bin/ssh''. -P, --pexec <pexec> The full path of the pexec program on the remote hosts. If this option is omitted, pexec tries to figure out from the invoking syn- tax and/or the current path. -T, --tunnel Internal use only (pexec will start in tunnel daemon mode). Remote control, mutual exclusions and atomic command execution: -y, --bind <port> This option lets pexec to be remote controlled via INET or UNIX domain sockets. -E, --pexec-connection-variable <env> This option overrides the default environment name PEXEC_REMOTE_PORT to the specified value, which is used by the ``-p|--connect auto'' combination to determine the control socket with which the running pexec instance can be controlled. -j, --remote Used to remote control and/or poll the status of other running instances of pexec. -p, --connect <port> Remote control port to connect to. -t, --status Prints the actual status of the running jobs in a human-readable form. -l, --lock <mutex> Locks the specified mutex (if the mutex is not locked by someone else, otherwise it will block until the mutex is released). -u, --unlock <mutex> Unlocks the specified mutex. -m, --mutex <mutex> Name of the mutex. -d, --dump <filename> Dump the content of the given file to standard output, if ``-m|--mutex'' is given, this will be atomic. -s, --save <filename> Save the content of standard input to the given file, if ``-m|--mutex'' is given, this will be atomic. -a, --atomic <command> Execute the given command. If ``-m|--mutex'' is given, the exectution is going to be atomic with respect to that mutex. Hypervisor mode: -H, --hypervisor Starts pexec in hypervisor mode. -C, --control <port> The control port used by the hypervisor. -l, --load <window> Use load also to limit the number of simultaneous processes with the specified load average interval (0, 1 or 2, or 1min, 5min or 15min, respectively). -f, --fifo First in first out queue processing. -s, --lifo Last in first out (stack) queue processing (default). Logging: -L, --log <file> The name of the log file. -W, --log-level <level> The logging level. -V, --verbose Increase the log level by one. REPORTING BUGS
Report bugs to <apal@szofi.elte.hu> COPYRIGHT
Copyright (C) 2007, 2008-2009; Pal, Andras <apal@szofi.elte.hu> This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. This software was written by Andras Pal. The core part was written while working for the Hungarian-made Automated Telescope (HAT) project to make the data processing more easier and therefore find many-many extrasolar planets. See more information about this project: http://hatnet.hu. Another internal libraries (e.g. numhash.[ch]) were primarily written for other projects. SEE ALSO
The full documentation for pexec is maintained as a Texinfo manual. If the info and pexec programs are properly installed at your site, the command info pexec should give you access to the complete manual. pexec 1.0rc8 (2009.07.02) June 2012 PEXEC(1)
All times are GMT -4. The time now is 09:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy