[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Stupid shebang tricks & env -



* martin f krafft [Wed, 11 May 2005 19:13:49 +0200]:
> also sprach Geert Stappers <stappers@stappers.nl> [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 even this:

    #! /usr/bin/smartenv program "an argument" "2 3"

  With:

    -------->8 /usr/bin/smartenv 8<-------------
    #! /bin/sh

    sh -c "$*"
    --------------------------------------------

  Now go and make /usr/bin/smartenv standard. :P

  (OK, this assumes the kernel passes the whole remaining of the
  she-bang line as $1, i.e. does not only pass until the first space.)

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
When all is summed up, a man never speaks of himself without loss; his
accusations of himself are always believed; his praises never.
                -- Michel de Montaigne



Reply to: