bug-bash
[Top][All Lists]
Advanced

[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 <address@hidden>:
> 
> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]