From: merlyn@stonehenge•com (Randal L. Schwartz)
To: Johannes Schindelin <Johannes.Schindelin@gmx•de>
Cc: Junio C Hamano <junkio@cox•net>, Alex Riesen <raa.lkml@gmail•com>,
git@vger•kernel.org
Subject: Re: [PATCH] Convert open("-|") to qx{} calls
Date: 23 Feb 2006 12:41:44 -0800 [thread overview]
Message-ID: <86lkw1g647.fsf@blue.stonehenge.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0602232039160.30630@wbgn013.biozentrum.uni-wuerzburg.de>
>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:
Johannes> Now that our local Perl guru joined the discussion, may I ask what
Johannes> is, and what is not quoted when put inside qx{}?
Nothing is quoted. Your string acts as if it was XXX in:
sh -c 'XXX'
so any quoting is entirely on your own. Thus, without the multi-arg exec in
my proposed replacement, you can get shell-ish interactions that can ruin your
day pretty bad.
Johannes> I had the
Johannes> impression that all arguments are quoted, except that variables are
Johannes> resolved first. Was that wrong? IOW does
Johannes> qx{bash $variable}
Johannes> quote the value of $variable, or not?
The Perl $variable is expanded to its current contents. But suppose the
contents are `date` (including the backquotes). That would mean that a shell
would execute a date command, and *its* output would then contribute further
to the command invocation.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge•com> <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!
next prev parent reply other threads:[~2006-02-23 20:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-23 14:33 [PATCH] Convert open("-|") to qx{} calls Johannes Schindelin
2006-02-23 15:38 ` Alex Riesen
2006-02-23 16:07 ` Randal L. Schwartz
2006-02-23 17:53 ` Junio C Hamano
2006-02-23 18:42 ` Randal L. Schwartz
2006-02-23 19:41 ` Johannes Schindelin
2006-02-23 20:41 ` Randal L. Schwartz [this message]
2006-02-23 21:14 ` Alex Riesen
2006-02-23 21:15 ` Randal L. Schwartz
2006-02-24 5:19 ` Rogan Dawes
2006-02-24 13:27 ` Alex Riesen
2006-02-24 14:29 ` Rogan Dawes
2006-02-24 15:25 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86lkw1g647.fsf@blue.stonehenge.com \
--to=merlyn@stonehenge$(echo .)com \
--cc=Johannes.Schindelin@gmx$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(echo .)net \
--cc=raa.lkml@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox