3.143.218.146 |    

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.002 seconds at 256.71 KB/s

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

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)