• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inhibiting Sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inhibiting Sleep


  • Subject: Re: Inhibiting Sleep
  • From: Paul Scott <email@hidden>
  • Date: Wed, 12 Jun 2013 12:08:42 -0700

2>&1 redirects standard error to standard out.

There are very few cases where you wouldn't use it. If you're trashing stdout, there's a very good likelihood you'll want to trash stderr. Since you may not be aware of when the program you're calling will write stderr, I recommend you always use 2>&1 when redirecting stdout to /dev/null; otherwise your script may fail unexpectedly in the future. Keep in mind that the placement of 2>&1 is very important; you'll usually want it AFTER the redirection of stdout. If you need stderr (most likely for debugging purposes), then redirect it separately to a file.

Paul

On 6/12/2013 11:46 AM, Luther Fuller wrote:
Can someone wearing a unix hat explain when "2>&1"
should and should not be used?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Inhibiting Sleep (From: Luther Fuller <email@hidden>)
 >Re: Inhibiting Sleep (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Inhibiting Sleep
  • Next by Date: Re: Inhibiting Sleep
  • Previous by thread: Re: Inhibiting Sleep
  • Next by thread: Re: Inhibiting Sleep
  • Index(es):
    • Date
    • Thread