>>>>> "Rajanikanth" == Rajanikanth Dandamudi <[EMAIL PROTECTED]> writes:

Rajanikanth> Hello,
Rajanikanth>         I had a problem understanding what the
Rajanikanth> expression ${1+"$@"} mean? can someone help me in
Rajanikanth> understanding this?

That's a very very old shell expression.  If $1 (the first shell
argument) is non-empty, then interpolate $@ (all the arguments) in
such a way as to retain their original quoting and whitespace.  It's
used a lot when one shell script wants to execute another command but
keep the precise argument structure.

As others in this thread have noted, it's also part of the "shell
exec" magic that you can place at the beginning of a Perl program to
tell the shell to run Perl on the file instead.  In this case, yes,
it's important that the shell pass the arguments *precisely* to Perl
in the same way that it got them -- hence the magic construct.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to