Standard error output to Pipe input - solved


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Standard error output to Pipe input - solved
# 1  
Old 02-19-2010
Standard error output to Pipe input - solved

Hi,
I want to check a particular word is in standard error output or not. Can I acheive it in single command?

For example,
Delete file_name 2>error.log

cat error.log

Output:
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
Successfully deleted
XXXXXXXXXXXXXXXXX

where delete is some external program.

I want to do Delete <file name> and grep the word "Success" in the same command.

Thanks & Regards,
Poova.

---------- Post updated at 08:38 PM ---------- Previous update was at 08:35 PM ----------

Delete <file_name> 2>error.log | grep "success" error.log

Will the above command work with out any problem.

Thanks & Regards,
Poova.
# 2  
Old 02-19-2010
Hi.

If you want to check for something only on standard error, direct standard error to standard output, then throw away standard output, then check

i.e.
Code:
Delete file_name 2>&1 > /dev/null | grep -i success

# 3  
Old 02-22-2010
Thanks a lot scottn.Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Input/output error

Hi issue with red hat and san. I had a LUN shared to me from an oracle storage I am able to see it and the size. ~]# multipath -ll mpathe (3600144f0e984617b00005b466bd70014) dm-3 SUN,ZFS Storage 7430 size=10T features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1... (0 Replies)
Discussion started by: goya
0 Replies

2. Homework & Coursework Questions

Removing punctuations from file input or standard input

Just started learning Unix and received my first assignment recently. We haven't learned many commands and honestly, I'm stumped. I'd like to receive assistance/guidance/hints. 1. The problem statement, all variables and given/known data: How do I write a shell script that takes in a file or... (4 Replies)
Discussion started by: fozilla
4 Replies

3. Shell Programming and Scripting

[Solved] Multiple input files and output files

Hi, I have many test*.ft1 files to which I want to read as input for a script called pipe2txt.tcl and print the output in each separate file. For example, pipe2txt.tcl < test001.ft1 > test001.txt How can I read many files in this maner? thank you very much, Best, Pahuja (5 Replies)
Discussion started by: Pahuja
5 Replies

4. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

5. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

6. Shell Programming and Scripting

Redirect standard error to input of other process, 2| ?

Hello, I would like to know if there is a shell in which operations such as 2| (redirect standard error of one process to the standard input of another one) exist? I know it is possible to do it in bash with things like: (process 2>&1) | other_process but I find it a bit intricate when... (3 Replies)
Discussion started by: chlorine
3 Replies

7. Shell Programming and Scripting

Command Output to Standard Input

Hi All, How do I provide the output of a command to another command which is waiting for an input from the user ? Ex : I need to login to a device via telnet. In the script, initially I use the "read" command to get the IP Address, Username and Password of the device from the user. Now,... (1 Reply)
Discussion started by: sushant172
1 Replies

8. 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

9. Shell Programming and Scripting

standard input

how can i redirect standard input? i dont remember :/, though could you redirec not from a command? i mean, to redirect always stdin and stout (1 Reply)
Discussion started by: Jariya
1 Replies

10. UNIX for Dummies Questions & Answers

Error: Internal system error: Unable to initialize standard output file

Hey guys, need some help. Running AIX Version 5.2 and one of our cron jobs is writing errors to a log file. Any ideas on the following error message. Error: Internal system error: Unable to initialize standard output file I'm guessing more info might be needed, so let me know. Thanks (2 Replies)
Discussion started by: firkus
2 Replies
Login or Register to Ask a Question