54.226.34.209 |    

Navigation

Google Advertisement

This function redirect the pipe input to STDERR. http://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr

STDERR
  1. #!/bin/bash
  2. # *************************************************************
  3. # This function redirect the pipe input to STDERR.
  4. #
  5. # @param stream
  6. # @return string
  7. #
  8. function STDERR () {
  9.  
  10. cat - 1>&2
  11.  
  12. }
  13.  
  14. # remove the directory /bubu
  15. if rm /bubu 2>/dev/null; then
  16.     echo "Bubu is gone."
  17. else
  18.     echo "Has anyone seen Bubu?" | STDERR
  19. fi
  20.  
  21.  
  22. # run the bubu.sh and redirect you output
  23. tux@earth:~$ ./bubu.sh >/tmp/bubu.log 2>/tmp/bubu.err
Parsed in 0.034 seconds at 13.11 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 11 users online.

Tags Cloud

Latest snippets
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)
STDERR
(Bash::Function)
radius
(CSS)
shadow
(CSS)
rotate
(CSS)
create_function
(JavaScript::Snippets)