1. csh - trap std out and redirect stderr to /dev/null
Here's the problem:
I want to trap the results of an ls command in a C-shell variable
without having stderr sent to my terminal session.
set checked_out_files=`ls SCCS/p.*`
if ($#checked_out_files > 0) then
This functions in the way I want, except a "No Match" error is sent to
the terminal when there are no p.* files in the SCCS directory. I don't
want the user to see the error.
I've tried the following as a replacement for the "set" above, but
this does not trap stdout.
set checked_out_files=`(ls SCCS/p.* > /dev/tty) >& /dev/null`
I've solved my problem using sccs info, but I still want to know
how I would trap the results of a shell command into a shell variable
without directing stderr to the display. (I don't want the user to see
the errors at run time.)
__| o |__
Douglas Parker | Computer Sciences Corporation /_/-----\_\
teemc!gdls!parker | Come home. (Isn't English wonderful!) :-( \_\-----/_/
2. error compiling bind-4.9.3beta26 and debug message
3. problem with redirecting output to /dev/null
5. redirecting stdout,stderr and stdin to /dev/null
6. Mouse appears to be stuck in toilet mode
7. redirecting cron error output to /dev/null
9. Basic redirect question: stderr to /dev/null in cron job
10. redirecting console Output to /dev/null
11. C-shell :: redirecting stderr to /dev/null
12. Icmp, Udp floods redirected to /dev/null?
13. fork, execve, and redirecting it all to /dev/null?