[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read Built-in Parameter Behavior -- Null Byte Delimiter
From: |
Reuti |
Subject: |
Re: read Built-in Parameter Behavior -- Null Byte Delimiter |
Date: |
Mon, 25 Jan 2016 19:09:27 +0100 |
Hi,
> Am 19.01.2016 um 17:49 schrieb Greg Wooledge <wooledg@eeg.ccf.org>:
>
> On Tue, Jan 19, 2016 at 11:39:07AM -0500, Adam Danischewski wrote:
>> Bash also removes the single quotes before it hits read when the single
>> quotes are attached to the delimiter option (-d'').
>
> And in EVERY OTHER COMMAND. This is how quotes work. This is utterly
> fundamental to bash and the entire Bourne shell syntax.
>
> echo ""'a'''$''""''
>
> Is *exactly* the same as
>
> echo a
>
> Echo has no way to know that you typed a and not "a" or a"" or 'a' or ....
Sometimes I miss a feature in Bash to get access to the plain command line the
user typed, including all quotes and other redirections - just as someone would
press the cursor up key on the command line to get the last line. E.g. like an
environment variable INVOCATION_LINE which I can check in a started script.
The reason for this is to remember the exact command the user typed to submit a
job to our queuingsystems in our clusters (there is a field for comments in the
queuingsystem, and the users requested a feature to look up what they typed
initially at a later point in time, i.e. when the job has finished, for exactly
this particular job - so the bash history is no option here).
Sure, I can take the command line and enclose all options in quotes and put
this in the comment field. But this won't work in case some path expansion took
place, process substitutions, input/output redirections, using quotes in
arguments.
-- Reuti
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, (continued)
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Piotr Grzybowski, 2016/01/16
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Martijn Dekker, 2016/01/16
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Greg Wooledge, 2016/01/18
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Chet Ramey, 2016/01/18
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Greg Wooledge, 2016/01/18
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Chet Ramey, 2016/01/18
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Adam Danischewski, 2016/01/19
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Greg Wooledge, 2016/01/19
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Adam Danischewski, 2016/01/19
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Greg Wooledge, 2016/01/19
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter,
Reuti <=
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Greg Wooledge, 2016/01/25
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Reuti, 2016/01/30
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Stephane Chazelas, 2016/01/18
- Re: read Built-in Parameter Behavior -- Null Byte Delimiter, Stephane Chazelas, 2016/01/18