SPUG: redirect close

Wim Kerkhoff wim at nyetwork.org
Mon Aug 26 13:21:58 CDT 2002


Baker, Stephen M:
> I'm maintaining a program where I constantly see 
> 	
> 	2>&1 
> 
> which I believe redirects STDOUT to STDIN, but regardless of 

Actually that redirects STDERR to the same place as STDIN. 2>&1 is a
fairly standard bash trick to easily capture errors, see the REDIRECTION
section in bash(1).

> what exactly it
> does I'm aware its a redirect of some kind and I would really 
> like to know
> its scope for declaration and how to cut it off.  Is it 
> limited to the block
> it is declared in, or does this type of command continue to 
> live on outside
> of a give code block.

Wim


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list