Seems like it is not so much a bash issue as possibly a kernel issue
with nesting the #! :

http://www.in-ulm.de/~mascheck/various/shebang/#interpreter-script

Apparently, nesting was not enabled until the 2.6.27.9 kernel.

It turns out that RHEL/CentOS 5.x versions only go up to kernel
2.6.18.  While RHEL/CentOS 6.x versions start at kernel 2.6.32.  And
Ubuntu systems as far back as 9.04 shipped with 2.6.28.

Regards,
- Robert

On Fri, Aug 10, 2012 at 11:30 PM, Robert Citek <[email protected]> wrote:
> Logging is just a fill-in example.   An abstraction of the general
> case would be:
>
> #!/bin/bash
> do_something_first
> run_program
> do_something_last
>
> do_something_first could be logging, sending an e-mail, or preparing a
> special environment.
> run_program could be the original program or perhaps modified
> conditions (e.g. niced or additional/modified arguments)
> do_something_last could be some kind of clean up process.
>
> Regards,
> - Robert
>
> On Thu, Aug 9, 2012 at 3:23 PM, Andrew Freiberger <[email protected]> 
> wrote:
>> if you're intent is to replace /usr/bin/perl with a logging wrapper, that's
>> best done in a compiled language as the #! is a shell interpreted special
>> handler.
>>
>> Or maybe selinux or process accounting can do your logging for you
>>
>> -Drew
>>
>> On Thu, Aug 9, 2012 at 1:53 PM, Robert Citek <[email protected]> wrote:
>>>
>>> On Thu, Aug 9, 2012 at 2:28 PM, Seibel, Rich <[email protected]> wrote:
>>> > It works for me if I change the first line of hw.pl to
>>> > #!/bin/bash perl.sh
>>>
>>> That work.  As did '#!/bin/env perl.sh' Unfortunately, that would mean
>>> modifying the perl scripts, something I don't want to do.
>>>
>>> Regards,
>>> - Robert
>>>
>>> _______________________________________________
>>> Discuss mailing list
>>> [email protected]
>>> http://www.sluug.org/mailman/listinfo/discuss
>>
>>
>>
>> _______________________________________________
>> Discuss mailing list
>> [email protected]
>> http://www.sluug.org/mailman/listinfo/discuss
>>

-- 
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug

Reply via email to