[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: child_pid of background process? (not in manpage?)

From: Linda Walsh
Subject: Re: child_pid of background process? (not in manpage?)
Date: Mon, 19 Aug 2013 16:32:18 -0700
User-agent: Thunderbird

Chet Ramey wrote:
On 8/19/13 1:52 PM, Linda Walsh wrote:
That explains it... There's -- in searching the output, I'm
pretty sure that seeing a stray '!' in the left hand margin
wouldn't have looked like a var.

In this case, especially for the 1 char vars, wouldn't it be
easier to help people see them and help them search for them
if they included the '$' before them so they wouldn't look
like stray punctuation?  or so I could search on \$[^a-zA-Z0-0]
and find it?

It might.  It might also result in many more people complaining that
the name of the variable is really `!', not `$!', so why am I including
the dollar sign, and only for the single-character variables?  Based on
history, the chances are 50-50.

Maybe you need to expand the group(s) you associate with? ;-)

If you are talking to the casual shell/bash using public, instead of
pedants or POSIX members, I think you'd find a distinctly different ratio.

I don't think I've ever heard the question you are talking about
in the (1) Perl community -- but then you wouldn't be talking to a bunch
of pedantic POSIX members if you were talking about perl.

If you were talking to a larger audience talking about (2) Windows/command
scripting or environment vars, you wouldn't have anyone questioning
the usage of showing the syntax used to reference the var as part
of the varname.
The following table lists the system and local environment variables for Windows XP.
  Variable      Type    Description

  %ALLUSERSPROFILE%     Local   Returns the location of the All Users Profile.
  %APPDATA%             Local   Returns the location where applications store 
data by default.
  %CD%                  Local   Returns the current directory string.
%CMDCMDLINE% Local Returns the exact command line used to start the current Cmd.exe. %CMDEXTVERSION% System Returns the version number of the current Command Processor Extensions.


Or lets say I look at in the (3) BASH manpage,
under "backslash escape sequences".

Words of the form $'string' are treated specially.  The word expands to
       string,  with backslash-escaped characters replaced as specified by the
       ANSI C standard.  Backslash escape sequences, if present,  are  decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \E     an escape character
...           \nnn .. \xHH \uHHHH ...

The prefixes of the backslash escape sequences, are shown with the backslash
just as in the ANSI C definition.

If a pedant asks you why put the prefixes that are
needed to make something be interpreted as a varname, for the
same reason that backslash sequences are shown starting with "\".

There are 3 examples where the prefix char is shown, including, in the
BASH manpage document.   I'd say that usage wise or for BASH's documentation
to be consistent with itself, I think prefixes seem to be the most common


However,  ***MINIMALLY***,  The biggest omission was not
listing those single char vars under the "BASH VARIABLES" section.

Where does one look in the bash manpage to find Bash's
variable list?

While I suggested showing them prefixed with '$', as that seems
a more common practice outside of formal documents (humans need more
context than computers that can be table and section driven),
if I had found them under the BASH Vars section, I wouldn't have
raised the issue.

In fact, I'd go so far as to say that under the Bash Vars section,
since none of the other vars have '$' in front of them, then
making the single-char names be exceptions would look 'out-of-place',

but outside of that section where it is clear that you are only listing
the name portion, after the sigil, I think the example as
set by the  backslash codes would help consistency.  I'll bet that
POSIX specification has the same internal consistencies because they
were written at different times by different people.

reply via email to

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