Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 11:01 PM, Antoon Pardon wrote: > On 22-04-14 14:26, Chris Angelico wrote: > >> On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon >> wrote: >>> Yes that was it. I changed the first line of my script to: >>> >>> #!/opt/local/bin/python2.7 >>> >>> and it now works. >> Excellent

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > Excellent! Shebangs are *extremely* specific, so you may want to > consider

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon wrote: > Yes that was it. I changed the first line of my script to: > > #!/opt/local/bin/python2.7 > > and it now works. Excellent! Shebangs are *extremely* specific, so you may want to consider using "/usr/bin/env python" to get a bit more flexibil

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:09, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 8:29 PM, Antoon Pardon > wrote: >> However if I call the script directly and want the #! line do its work I get >> the following error. >> >> # /usr/local/bin/ldapwatch /opt/local/log/openldap.log | head >> /usr/local/bin/ldapwatc