• 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: PATH variable for do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATH variable for do shell script


  • Subject: Re: PATH variable for do shell script
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 03 Nov 2015 03:48:23 -0600

On Nov 03, 2015, at 02:35, Yvan KOENIG <email@hidden> wrote:
What's the exact meaning of :
"/usr/bin:/bin:/usr/sbin:/sbin"
______________________________________________________________________

Hey Yvan,

This is not a path.  This is a list of paths that the shell will search for commands.

Each path is terminated by the colon character.

https://en.wikipedia.org/wiki/PATH_(variable)

On POSIX and Unix-like operating systems, the $PATH variable is specified as a list of one or more directory names separated by colon (:) characters.[2][3]

I usually add this to my do shell script commands:

export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH;

And that saves me from having to provide the full path to user-installed executables.

AppleScript normally sees:
/usr/bin:/bin:/usr/sbin:/sbin

The export command is stacking additional directories on the the existing $PATH.

/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

--
Take Care,
Chris

 _______________________________________________
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: 
 >PATH variable for do shell script (From: "Alan Harper (lists)" <email@hidden>)
 >Re: PATH variable for do shell script (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: PATH variable for do shell script
  • Next by Date: Re: PATH variable for do shell script
  • Previous by thread: Re: PATH variable for do shell script
  • Next by thread: Re: PATH variable for do shell script
  • Index(es):
    • Date
    • Thread