Re: Understanding PATH$ variable

2019-09-24 Thread David Wright
On Mon 23 Sep 2019 at 11:32:46 (-0400), Greg Wooledge wrote: > On Sun, Sep 22, 2019 at 05:21:27PM +0200, Thomas Schmitt wrote: > > PATH is a convention of shells like bash or dash, not of Python. > > In your examples it lets the shell parser find /usr/bin/python from > > "python". > > It's also us

Re: Understanding PATH$ variable

2019-09-24 Thread David Wright
On Mon 23 Sep 2019 at 06:10:22 (-0500), Richard Owlett wrote: > On 09/23/2019 03:36 AM, Curt wrote: > > [snip] > > > > Honestly, I took the name 'script'.py for a metasyntactic variable. > > Yes that was my intention. My question was concerning all scripts. > Mentioning the specific script would

Re: Understanding PATH$ variable

2019-09-23 Thread Greg Wooledge
On Mon, Sep 23, 2019 at 01:12:14PM -0400, Greg Wooledge wrote: > On Mon, Sep 23, 2019 at 06:56:47PM +0200, Thomas Schmitt wrote: > > Problem is that Richard Owlett expected it to work in the starter program > > of the interpreter (here: /usr/bin/python) when it opens the script file > > for reading

Re: Understanding PATH$ variable

2019-09-23 Thread Greg Wooledge
On Mon, Sep 23, 2019 at 06:56:47PM +0200, Thomas Schmitt wrote: > Greg Wooledge wrote: > > I'd be rather surprised if there's *no* function in Python that uses > > the PATH variable. > > Problem is that Richard Owlett expected it to work in the starter program > of the interpreter (here: /usr/bin/

Re: Understanding PATH$ variable

2019-09-23 Thread Thomas Schmitt
Hi, Greg Wooledge wrote: > I'd be rather surprised if there's *no* function in Python that uses > the PATH variable. Problem is that Richard Owlett expected it to work in the starter program of the interpreter (here: /usr/bin/python) when it opens the script file for reading. I assume Python deve

Re: Understanding PATH$ variable

2019-09-23 Thread Greg Wooledge
On Sun, Sep 22, 2019 at 05:21:27PM +0200, Thomas Schmitt wrote: > PATH is a convention of shells like bash or dash, not of Python. > In your examples it lets the shell parser find /usr/bin/python from > "python". It's also used by some of the libc exec wrappers. Specifically, the ones with "p" in

Re: Understanding PATH$ variable

2019-09-23 Thread Richard Owlett
On 09/23/2019 03:36 AM, Curt wrote: [snip] Honestly, I took the name 'script'.py for a metasyntactic variable. Yes that was my intention. My question was concerning all scripts. Mentioning the specific script would be "noise". I can't see offhand why it couldn't easily be changed if it was

Re: Understanding PATH$ variable

2019-09-23 Thread Richard Owlett
On 09/22/2019 05:00 PM, David Wright wrote: On Sun 22 Sep 2019 at 16:31:22 (-), Curt wrote: On 2019-09-22, Thomas Schmitt wrote: So to avoid the cd command with absolute path, you would have to give the script address as absolute path: python /path/to/script/script.py I make my loc

Re: Understanding PATH$ variable

2019-09-23 Thread Richard Owlett
On 09/22/2019 07:59 PM, David wrote: On Mon, 23 Sep 2019 at 00:10, Richard Owlett wrote: May I be pointed to a complete explanation of the use of the PATH$ environmental variable. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html Section 8.3, subheading PATH Thank yo

Re: Understanding PATH$ variable

2019-09-23 Thread Curt
On 2019-09-22, David Wright wrote: > On Sun 22 Sep 2019 at 16:31:22 (-), Curt wrote: >> On 2019-09-22, Thomas Schmitt wrote: >> > >> > So to avoid the cd command with absolute path, you would have to give >> > the script address as absolute path: >> > >> > python /path/to/script/script.py >

Re: Understanding PATH$ variable

2019-09-22 Thread David
On Mon, 23 Sep 2019 at 00:10, Richard Owlett wrote: > May I be pointed to a complete explanation of the use of the PATH$ > environmental variable. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html Section 8.3, subheading PATH

Re: Understanding PATH$ variable

2019-09-22 Thread David Wright
On Sun 22 Sep 2019 at 16:31:22 (-), Curt wrote: > On 2019-09-22, Thomas Schmitt wrote: > > > > So to avoid the cd command with absolute path, you would have to give > > the script address as absolute path: > > > > python /path/to/script/script.py > > > > I make my local scripts executable a

Re: Understanding PATH$ variable

2019-09-22 Thread Brian
On Sun 22 Sep 2019 at 16:31:22 -, Curt wrote: > On 2019-09-22, Thomas Schmitt wrote: > > > > So to avoid the cd command with absolute path, you would have to give > > the script address as absolute path: > > > > python /path/to/script/script.py > > > > I make my local scripts executable an

Re: Understanding PATH$ variable

2019-09-22 Thread Curt
On 2019-09-22, Thomas Schmitt wrote: > > So to avoid the cd command with absolute path, you would have to give > the script address as absolute path: > > python /path/to/script/script.py > I make my local scripts executable and stick them in '/usr/local/bin'. > Have a nice day :) > > Thomas >

Re: Understanding PATH$ variable

2019-09-22 Thread David Wright
On Sun 22 Sep 2019 at 09:10:17 (-0500), Richard Owlett wrote: > I recently downloaded a python script which uses some custom helper > scripts. The scriptS are provided as zip file. The instructions were > ti download to chosen directory and un-zip the file. > > The launching instructions were to d

Re: Understanding PATH$ variable

2019-09-22 Thread Thomas Schmitt
Hi, Richard Owlett wrote: > The launching instructions were to do >cd /path/to/script > then >python script.py > I thought I could "simplify" my life by doing >export PATH=$PATH:/path/to/script > and then launch by doing just doing >python script.py > > That FAILED to find script.p

Re: Understanding PATH$ variable

2019-09-22 Thread Reco
Hi. On Sun, Sep 22, 2019 at 09:10:17AM -0500, Richard Owlett wrote: > May I be pointed to a complete explanation of the use of the PATH$ > environmental variable. bash(1), COMMAND EXECUTION section. Reco

Understanding PATH$ variable

2019-09-22 Thread Richard Owlett
I recently downloaded a python script which uses some custom helper scripts. The scriptS are provided as zip file. The instructions were ti download to chosen directory and un-zip the file. The launching instructions were to do cd /path/to/script then python script.py That *WORKS* as adv