Sponsored Content
Top Forums Shell Programming and Scripting Redirect script output to a file and mail the output Post 302852155 by Vivekit82 on Tuesday 10th of September 2013 04:04:18 PM
Old 09-10-2013
The problem is /home/home1/2.sh >> $OFILE is not working.
Script 2.sh output should be redirected to $OFILE which is not happening.
When i am running the command
Code:
./2.sh>>filename

it is not working.
Inside 2.sh script I am redirecting the output of this script to a filename1 and then mailing the output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

redirect output to file?

Hi: I am currently working on a program which requires direct its ouput to a file here is an example ./proram arg_1 arg_2 when program ends all output will be arg_2 file Is that possible I am not a bad programmer, However I am stuck there. Can anyone give a hint? Thanks SW (1 Reply)
Discussion started by: slackware
1 Replies

2. UNIX for Dummies Questions & Answers

Redirect output to a file

Ahhhrrrggg I'm having a brain fart... I want to take the output of a command and redirect it to a file... This works.... $ man cp | cat >> copy_help but this doesn't keytool -help |cat >> keytool_help It just produces... these lines... more keytool_help ] ... ... (11 Replies)
Discussion started by: jimmyc
11 Replies

3. Shell Programming and Scripting

redirect only the standard error output to mail

I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)
Discussion started by: barkath
3 Replies

4. Shell Programming and Scripting

Cronjob - Redirect mail output to file, LINES & COLUMNS

I currently have an expect script that issues the 'mail' command and sends an 'x' when it receives the & prompt from mail to quit. The expect script is able to do stty rows 100 columns 200 < $spawn_out(slave,name) to set up the number of columns and rows. I would like to get rid of the expect... (0 Replies)
Discussion started by: jharvey
0 Replies

5. Shell Programming and Scripting

how to redirect the output of a grep command to a file inside a shell script

hi, i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Discussion started by: kripssmart
11 Replies

6. Shell Programming and Scripting

Redirect bg process output to within the script

Hi, I have a process running in the background, which throws up some output to the terminal when I run my script. How can I read this output from my script? Thank you. (5 Replies)
Discussion started by: Theju
5 Replies

7. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

8. Shell Programming and Scripting

Redirect an output from a script to a file and display it at a console simultaneously

Hi, I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console. I've tried this command: myscript.sh | tail -f However, it doesn't end after the script finishes running I've also tried this: myscript.sh | tee ~/results.txt But it writes... (3 Replies)
Discussion started by: wenclu
3 Replies

9. Programming

How to redirect the output of a shell script to a file?

hi, i have a html form which call a perl program, this perl program calls a shell script. <html> <head> <title>demo</title> </head> <body> <form name="frm1" action="/cgi-bin/perl_script.pl" method="post"> <input type="text" name="fname"> ... (1 Reply)
Discussion started by: Little
1 Replies

10. Shell Programming and Scripting

Redirect script output to file after grep

i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file. #!/bin/bash for i in `seq 1 20`; do echo $i sleep 1 done ./test.sh |egrep "5|10|15" 5 10 15 r ./test.sh... (2 Replies)
Discussion started by: before4
2 Replies
STARTPAR(8)						      System Manager's Manual						       STARTPAR(8)

NAME
startpar - start runlevel scripts in parallel SYNOPSIS
startpar [-p par] [-i iorate] [-t timeout] [-T global_timeout] [-a arg] prg1 prg2 ... startpar [-p par] [-i iorate] [-t timeout] [-T global_timeout] -M [ boot|start|stop] DESCRIPTION
startpar is used to run multiple run-level scripts in parallel. The degree of parallelism on one CPU can be set with the -p option, the default is full parallelism. An argument to all of the scripts can be provided with the -a option. Processes block by pending I/O will weighting by the factor 800. To change this factor the option -i can be used to specify an other value. The output of each script is buffered and written when the script exits, so output lines of different scripts won't mix. You can modify this behaviour by setting a timeout. The timeout set with the -t option is used as buffer timeout. If the output buffer of a script is not empty and the last output was timeout seconds ago, startpar will flush the buffer. The -T option timeout works more globally. If no output is printed for more than global_timeout seconds, startpar will flush the buffer of the script with the oldest output. Afterwards it will only print output of this script until it is finished. The -M option switches startpar into a make(1) like behaviour. This option takes three different arguments: boot, start, and stop for reading .depend.boot or .depend.start or .depend.stop respectively in the directory /etc/init.d/. By scanning the boot and runlevel direc- tories in /etc/init.d/ it then executes the appropriate scripts in parallel. FILES
/etc/init.d/.depend.boot /etc/init.d/.depend.start /etc/init.d/.depend.stop SEE ALSO
init.d(7), insserv(8), startproc(8). COPYRIGHT
2003,2004 SuSE Linux AG, Nuernberg, Germany. 2007 SuSE LINUX Products GmbH, Nuernberg, Germany. AUTHOR
Michael Schroeder <mls@suse.de> Takashi Iwai <tiwai@suse.de> Werner Fink <werner@suse.de> Jun 2003 STARTPAR(8)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy