Re: Stupid shebang tricks & env -

2005-05-12 Thread Wesley J. Landaker
On Thursday 12 May 2005 20:43, Adeodato Simó wrote: > * Wesley J. Landaker [Thu, 12 May 2005 20:41:17 -0600]: > > On Thursday 12 May 2005 20:18, Adeodato Simó wrote: > > > Uhm, nice (one fork less), but then you can "quote arguments" (and > > > "$*" won't help here). > > > > But "$@" will. > >

Re: Stupid shebang tricks & env -

2005-05-12 Thread Adeodato Simó
* Wesley J. Landaker [Thu, 12 May 2005 20:41:17 -0600]: > On Thursday 12 May 2005 20:18, Adeodato Simó wrote: > > Uhm, nice (one fork less), but then you can "quote arguments" (and > > "$*" won't help here). > But "$@" will. No, sorry, it won't (I tested this stuff). At least in my system,

Re: Stupid shebang tricks & env -

2005-05-12 Thread Wesley J. Landaker
On Thursday 12 May 2005 20:18, Adeodato Simó wrote: > * martin f krafft [Fri, 13 May 2005 04:10:48 +0200]: > > also sprach Adeodato Simó <[EMAIL PROTECTED]> [2005.05.13.0338 +0200]: > > > >8 /usr/bin/smartenv 8<- > > > #! /bin/sh > > > > > > sh -c "$*" > > >

Re: Stupid shebang tricks & env -

2005-05-12 Thread Adeodato Simó
* martin f krafft [Fri, 13 May 2005 04:10:48 +0200]: > also sprach Adeodato Simó <[EMAIL PROTECTED]> [2005.05.13.0338 +0200]: > > >8 /usr/bin/smartenv 8<- > > #! /bin/sh > > sh -c "$*" > > > #!/bin/sh > exec $* Uh

Re: Stupid shebang tricks & env -

2005-05-12 Thread martin f krafft
also sprach Adeodato Simó <[EMAIL PROTECTED]> [2005.05.13.0338 +0200]: > >8 /usr/bin/smartenv 8<- > #! /bin/sh > > sh -c "$*" > #!/bin/sh exec $* > Now go and make /usr/bin/smartenv standard. :P it's just another

Re: Stupid shebang tricks & env -

2005-05-12 Thread Adeodato Simó
* martin f krafft [Wed, 11 May 2005 19:13:49 +0200]: > also sprach Geert Stappers <[EMAIL PROTECTED]> [2005.05.11.1802 +0200]: > > #!/usr/bin env - perl -w > > so, the extra hyphen, the trick? > No. shebang lines can only take one argument. This works: #! /usr/bin/smartenv perl -w And

Re: Stupid shebang tricks

2005-05-11 Thread Ben Finney
On 11-May-2005, Joey Hess wrote: > Ben Finney wrote: > > That would be a downside (and kills it for the primary use I had in > > mind, '#!/usr/bin/env perl -w'). > > Of course "#!/usr/bin/env perl\nuse warnings;" is equivilant. Ah, I think I see; you're suggesting to use the following script head

Re: Stupid shebang tricks

2005-05-11 Thread Ben Finney
On 11-May-2005, Joey Hess wrote: > Ben Finney wrote: > > That would be a downside (and kills it for the primary use I had in > > mind, '#!/usr/bin/env perl -w'). > > Of course "#!/usr/bin/env perl\nuse warnings;" is equivilant. That still seems to fall foul of the "shebang only recognises one com

Re: Stupid shebang tricks & env -

2005-05-11 Thread martin f krafft
also sprach Geert Stappers <[EMAIL PROTECTED]> [2005.05.11.1802 +0200]: > #!/usr/bin env - perl -w > > so, the extra hyphen, the trick? No. shebang lines can only take one argument. -- Please do not send copies of list mail to me; I read the list! .''`. martin f. krafft <[EMAIL PROTECTE

Re: {SPAM} Stupid shebang tricks

2005-05-11 Thread Sven Mueller
Daniel Ruoso wrote on 11/05/2005 18:07: > Em Ter, 2005-05-10 às 22:07, Ben Finney escreveu: > >>Yes, I've always been impressed with that trick (in direct proportion >>to the hatred I had of '#!/usr/bin/perl' and '#!/usr/local/bin/perl' >>wars). > > Considering we are in Debian, isn't alternative

Re: Stupid shebang tricks & env -

2005-05-11 Thread Sven Mueller
Geert Stappers wrote on 11/05/2005 18:02: > Does > > #!/usr/bin env - perl -w > > so, the extra hyphen, the trick? This has the additional problem that "-" implies "-i", which starts with an empty environment. And many script actually use environment variables to control their behaviour. cu, s

Re: Stupid shebang tricks & env -

2005-05-11 Thread Geert Stappers
On Wed, May 11, 2005 at 03:48:51PM +0200, martin f krafft wrote: > also sprach Bas Zoetekouw <[EMAIL PROTECTED]> [2005.05.11.1528 +0200]: > > > True. But before it will even be considered to make env standard, > > > the parameter problem would have to be solved. perl -w and /bin/sh > > > -e are jus

Re: {SPAM} Stupid shebang tricks

2005-05-11 Thread Daniel Ruoso
Em Ter, 2005-05-10 às 22:07, Ben Finney escreveu: > Yes, I've always been impressed with that trick (in direct proportion > to the hatred I had of '#!/usr/bin/perl' and '#!/usr/local/bin/perl' > wars). Considering we are in Debian, isn't alternatives the appropriate solution for the different poss

Re: Stupid shebang tricks

2005-05-11 Thread Joey Hess
Ben Finney wrote: > That would be a downside (and kills it for the primary use I had in > mind, '#!/usr/bin/env perl -w'). Of course "#!/usr/bin/env perl\nuse warnings;" is equivilant. -- see shy jo signature.asc Description: Digital signature

Re: Stupid shebang tricks

2005-05-11 Thread martin f krafft
also sprach Bas Zoetekouw <[EMAIL PROTECTED]> [2005.05.11.1528 +0200]: > > True. But before it will even be considered to make env standard, > > the parameter problem would have to be solved. perl -w and /bin/sh > > -e are just necessary. > > Just put "use warnings;" or "set -e" in the script. Ye

Re: Stupid shebang tricks

2005-05-11 Thread martin f krafft
also sprach Roger Leigh <[EMAIL PROTECTED]> [2005.05.11.1526 +0200]: > My solution, using perl scripts as an example, is to write > > [EMAIL PROTECTED]@ -w > > and use autoconf to generate the script for me, using > > AC_PATH_PROG([PERL], [perl]) This is not a solution for the problem being

Re: Stupid shebang tricks

2005-05-11 Thread Bas Zoetekouw
Hi martin! You wrote: > True. But before it will even be considered to make env standard, > the parameter problem would have to be solved. perl -w and /bin/sh > -e are just necessary. Just put "use warnings;" or "set -e" in the script. -- Kind regards, +

Re: Stupid shebang tricks

2005-05-11 Thread Roger Leigh
On Wed, May 11, 2005 at 11:04:06PM +1000, Ben Finney wrote: > On 11-May-2005, martin f krafft wrote: > > also sprach Ben Finney <[EMAIL PROTECTED]> [2005.05.11.0307 +0200]: > > > To what extent should that be used? Is it reasonable to do it for > > > *any* shebang line? '#!/usr/bin/env make'? '#!/u

Re: Stupid shebang tricks

2005-05-11 Thread martin f krafft
also sprach Ben Finney <[EMAIL PROTECTED]> [2005.05.11.1504 +0200]: > The context of the '#!/usr/bin/env python' trick extends beyond > Debian though; the whole point is that a lookup will work in > environments where the location of the executable *isn't* the > standard one. True. But before it w

Re: Stupid shebang tricks

2005-05-11 Thread Ben Finney
On 11-May-2005, martin f krafft wrote: > also sprach Ben Finney <[EMAIL PROTECTED]> [2005.05.11.0307 +0200]: > > To what extent should that be used? Is it reasonable to do it for > > *any* shebang line? '#!/usr/bin/env make'? '#!/usr/bin/env bash'? > > Are there any downsides? > > Performance. Th

Re: Stupid shebang tricks

2005-05-11 Thread martin f krafft
also sprach Ben Finney <[EMAIL PROTECTED]> [2005.05.11.0307 +0200]: > To what extent should that be used? Is it reasonable to do it for > *any* shebang line? '#!/usr/bin/env make'? '#!/usr/bin/env bash'? > Are there any downsides? Performance. Debian standardises executable locations, so there is

Re: Stupid shebang tricks

2005-05-11 Thread Florent Rougon
Ben Finney <[EMAIL PROTECTED]> wrote: > Is '/usr/bin/env' part of the POSIX spec? Is its behaviour with regard > to command arguments defined? Where would I find out? It is part of POSIX: http://www.opengroup.org/onlinepubs/009695399/utilities/env.html The problem is not with env, but with sh

Re: Stupid shebang tricks

2005-05-10 Thread Ben Finney
On 11-May-2005, Robert Collins wrote: > On Wed, 2005-05-11 at 11:07 +1000, Ben Finney wrote: > > To what extent should that be used? Is it reasonable to do it for > > *any* shebang line? '#!/usr/bin/env make'? '#!/usr/bin/env bash'? > > Are there any downsides? > > AFAIK you can't pass parameters

Re: Stupid shebang tricks

2005-05-10 Thread Goswin von Brederlow
Ben Finney <[EMAIL PROTECTED]> writes: > On 11-May-2005, Goswin von Brederlow wrote: >> Ben Finney <[EMAIL PROTECTED]> writes: >> > The good thing about the (standard?) shebang convention -- using a >> > first line of '#!/path/to/shell' in the executable file -- is that >> > you can have executabl

Re: Stupid shebang tricks

2005-05-10 Thread Robert Collins
On Wed, 2005-05-11 at 11:07 +1000, Ben Finney wrote: > > To what extent should that be used? Is it reasonable to do it for > *any* shebang line? '#!/usr/bin/env make'? '#!/usr/bin/env bash'? > Are there any downsides? AFAIK you can't pass parameters to the program : #!/bin/env python --debug S

Stupid shebang tricks

2005-05-10 Thread Ben Finney
On 11-May-2005, Goswin von Brederlow wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > The good thing about the (standard?) shebang convention -- using a > > first line of '#!/path/to/shell' in the executable file -- is that > > you can have executable scripts shared even between different > > Un