how to redirect stderr from top with csh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to redirect stderr from top with csh
# 1  
Old 02-22-2007
how to redirect stderr from top with csh

Hello all
im trying to use top program in my csh shell
like this :
set topResult = `top | grep server.exe`

but im facing 2 problems
1.when the top program dont installed in the machine im getting error
so can i check in csh if application im using exist

2 the top program gives me stderr and stdout i like to redirect the sdterr to null
and keep only the stdout in the variable

thanks
# 2  
Old 02-22-2007
Well, this page says that you can't really do that in csh. And that you should stop writing scripts in csh and move on to sh or ksh.
# 3  
Old 02-23-2007
hi thanks for the reply
i know this page but still i need to find some kind of solution (there is always some solution )
im working on csh because the work force me to
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to redirect stderr to a file as well

Hello everyone, I'm a nooby in Linux, and I need some help. I have a shell script like this: echo "Start of script" > ../My_Log_Dir/Script_Name.log .. cp ../My_DataIn/File.txt ../My_DataOut/ 2>> ../My_Log_Dir/Script_Name.log rc=$? .. echo "End of Script" >>... (5 Replies)
Discussion started by: H.Faria
5 Replies

2. Red Hat

Redirect STDOUT and STDERR of chsh

EDIT: Nevermind, figured it out! Forgot to put backslashes in my perl script to not process literals! Hi everyone. I am trying to have this command pass silently. (no output) chsh -s /bin/sh news Currently it outputs. I've tried.... &> /dev/null 1> /dev/null 2>&1 /dev/null 1>&2... (1 Reply)
Discussion started by: austinharris43
1 Replies

3. Shell Programming and Scripting

How to redirect the STDERR to a variable in perl?

in my perl script i tried the below statement $result = `cleartool rmstream -f $s1 1> /dev/null`; so as to redirect then error messages,when i print the $result ,it seems to be Null. (4 Replies)
Discussion started by: ram_unx
4 Replies

4. UNIX for Dummies Questions & Answers

Redirect just stderr to a file with a timestamp

I'm using below command to redirect stderr to a file but I also want to add timestamp to stderr.out to find out the date / time the error occurred. ls -ltr 2>>/tmp/stderr.out Thanks (5 Replies)
Discussion started by: mbak
5 Replies

5. Shell Programming and Scripting

How to redirect stderr and stdout to a file

Hi friends I am facing one problem while redirecting the out of the stderr and stdout to a file let example my problem with a simple example I have a file (say test.sh)in which i run 2 command in the background ps -ef & ls & and now i am run this file and redirect the output to a file... (8 Replies)
Discussion started by: sushantnirwan
8 Replies

6. Shell Programming and Scripting

can't redirect stderr in bash

Consider: #!/bin/sh #this is a shell script in sh (bourne) grep missingfile 2>errout.txt It works from the command line, but keeps producing errors from the script. So how do I redirect in a bash shell...or bourne? (3 Replies)
Discussion started by: lumix
3 Replies

7. Shell Programming and Scripting

how can i redirect stderr to file in Make?

Hello all im using tcsh shell on sun Solaris , using the Make utility for compilation i will like to be able to redirect the stderr to file , how can it be done ? (0 Replies)
Discussion started by: umen
0 Replies

8. Shell Programming and Scripting

csh stderr redirection

Hi everyone, Simple scripting question here. I have: #!/bin/csh if ( -e $HOME/*.core) then rm -f $HOME/*.core >& /dev/null else echo "No core files to delete." endif But I keep getting the /home/user/*.core: no match dialog. How can I suppress this? or, why is... (0 Replies)
Discussion started by: jolok
0 Replies

9. Shell Programming and Scripting

Redirect stdout and stderr

How can I redirect and append stdout and stderr to a file when using cron? Here is my crontab file: */5 * * * * /dir/php /dir/process_fns.php >>& /dir/dump.txt Cron gives me an 'unexpected character found in line' when trying to add my crontab file. Regards, Zach Curtis POPULUS (8 Replies)
Discussion started by: zcurtis
8 Replies

10. Shell Programming and Scripting

stderr redirection in csh script

Man pages....look at the man pages. If you don't have them, you can find them on-line. Read them when you have nothing better to do. Find new commands and new ways of doing things. The answer: The only way to direct the standard output and standard error separately is by invoking... (0 Replies)
Discussion started by: thehoghunter
0 Replies
Login or Register to Ask a Question