![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script to execute user command | redtiger | Shell Programming and Scripting | 1 | 04-30-2008 06:53 PM |
| execute shell command in perlscript | amitrajvarma | Shell Programming and Scripting | 0 | 11-27-2007 02:49 AM |
| become SU - ...Silently | systemali | Shell Programming and Scripting | 9 | 03-27-2006 10:40 AM |
| Plz Help : How to use write command to execute command on some other terminal | Aashish | UNIX for Dummies Questions & Answers | 2 | 03-03-2006 12:25 PM |
| Urgent!! How to write a shell program to execute command to access internet? | firebirdonfire | UNIX for Dummies Questions & Answers | 2 | 04-26-2001 11:16 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
execute a command silently or quietly within a shell
How do I suspend output of commands and tools that sometimes utter unwanted output? I know that I can always pipe to null or some such thing, but is there a simpler more elegant (i.e. accepted) practice?
|
|
||||
|
I really have to learn to phrase more carefully. I didn't mean to imply error output, but really just the FYI kind of messages that might complement the actual work or output of a tool. Something like "...done. 5 instances found", where the work was desired, but the chit chat wasn't.
If I remember correctly, in DOS this was accomplished by preceding the statement with an apostrophe. Now it's done by "echo off". Thanks for the reply, btw. |
|
||||
|
A process normally has two outputs to screen: stdout (standard out), and stderr (standard error).
Normally informational messages go to sdout, and errors and alerts go to stderr. You can turn off stdout for a command by doing Code:
mycommand >/dev/null Code:
mycommand 2>/dev/null Code:
mycommand 2>&1 >/dev/null Turning around the notes about the "-v" for verbose convention; some commands have a "-q" (quiet) option, eg. "grep -q". |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|