Sponsored Content
Top Forums Shell Programming and Scripting saving output from bash into a file Post 302531381 by eponcedeleonc on Thursday 16th of June 2011 03:24:19 PM
Old 06-16-2011
Thank you...
This accomplish some of what I need, that is printing the output to a file, but not in the way that I want to. I reallly apreciate the help!
this is more of what I need....

Code:
abhmq01.abh-sort.us.dhl.com fail
abhxdb01d.abh-sort.us.dhl.com fail
admpae1-65.phx-dc.dhl.com fail
AND WHEN IT SUCCEDS LOGIN IN TO SERVER....TO PRINT THE CONTENTS OF THE FILE /usr/openv/netbackup/exclude_list IN 1 LINE IN THE FORMAT YOU SUGGESTED...("tr '\n' ' ' < /usr/openv/netbackup/exclude_list")


Last edited by eponcedeleonc; 06-16-2011 at 04:30 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving output from awk into a perl variable

How would I pass awk output to a perl variable? For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct. $test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Discussion started by: userix
8 Replies

2. Shell Programming and Scripting

saving awk value in a bash array variable

hi all i am trying to save an awk value into an array in bash: total=`awk '{sum+=$3} END {print sum}' "$count".txt"` ((count++)) the above statement is in a while loop.. $count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.) i get the following error: ./lines1:... (1 Reply)
Discussion started by: npatwardhan
1 Replies

3. UNIX for Dummies Questions & Answers

saving command output to a variable

Hello, I have a shell script containing a command string in the following format: command1 | command2 | cut -c9-16 The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234 I wish to save this value to a variable for use in later commands... (4 Replies)
Discussion started by: philjo
4 Replies

4. UNIX for Dummies Questions & Answers

Saving a temporary output within a script

Good morning everyone, i am looking to know how to save the output of a command and reuse it again within a script i already tired this one but it didn't work TEMPDIR=/dir1/dir2 My_command> $TEMPDIR/$TEMPFILE rm $TEMPDIR/$TEMPFILE* it keeps saying "cannot write to a... (15 Replies)
Discussion started by: Portabello
15 Replies

5. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory using grep....plz ...

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt Code: ... (0 Replies)
Discussion started by: ektubbe
0 Replies

6. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt msisdn ... (5 Replies)
Discussion started by: ektubbe
5 Replies

7. Shell Programming and Scripting

looping and saving output of each line separately

I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Discussion started by: iconig
17 Replies

8. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

9. Shell Programming and Scripting

Saving files with file name as output

Hi, i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory. If i give this command : -o spec$(date -u +%Y%m%dt%H%M) it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
Discussion started by: Board27
2 Replies

10. Shell Programming and Scripting

sed command is saving output as blank file

Hi, I am working on a script where I am adding adding colors to few of the info in the output. Now , after that is done , I see colour codes in log files which I don't want to see.:mad::mad::mad::mad: So , I tried using sed command in script as below which gives me o/p (new.log) as blank file... (7 Replies)
Discussion started by: Dream4649
7 Replies
REPORTER-PRINT(1)						 LIBREPORT MANUAL						 REPORTER-PRINT(1)

NAME
reporter-print - Prints problem information to standard output or FILE. SYNOPSIS
reporter-print [-v] [-d DIR] [-o FILE] [-a yes/no] [-r] DESCRIPTION
The tool reads problem directory DIR and prints its text representation to stdout or to a specified FILE. Integration with ABRT events reporter-print can be used as a reporter, to allow users to report problems by writing them to a file. Example: EVENT=report reporter-print -o "${Log_File:-/tmp/abrt.log}" OPTIONS
-d DIR Path to problem directory. -v Be more verbose. Can be given multiple times. -o FILE Output file -a yes/no If -o FILE is specified, controls whether FILE is appended to, or overwritten. (default: no) -r Add a record to reported_to in DIR which specifies that this problem was reported. Some tools use this to differentiate between problems which were and weren't yet reported. Output format The output is designed to be machine-parsable. The elements which have only one line are printed in the form NAME:<whitespace>VALUE Elements which have more than one line are printed in the form NAME: :LINE1 :LINE2 :LINE3 Output may contain empty lines for better readability. AUTHORS
o ABRT team LIBREPORT 2.1.11 06/18/2014 REPORTER-PRINT(1)
All times are GMT -4. The time now is 11:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy