From the bash info page: Only `\' and `'' may be used to escape the historyexpansion character. I have tried the following: echo '!' # works fine, displays "!" echo "!" # errors as expected with "e
Diff of rendering (DWB): - sonal initialization file /.bashrc if the shell is + sonal initialization file ~/.bashrc if the shell is - files /.bash_profile, /.bash_login, or /.profile. By - default, b
Thank you for your report. However this is intended behavior. And it is also documented! :-) man bash Enclosing characters in doublequotes preserves the literal value of all characters within the qu
Really. This is from the man page, in the QUOTING section: Enclosing characters in doublequotes preserves the literal value of all characters within the quotes, with the exception of $, `, \, and,
If a printable character has special meaning in syntax for representing data strings, then in any situation where it's special, it is expected to be possible to disable that specialness by prefixing
But how come the backslash in double-quotes is both 1) inhibiting historyexpansion, and 2) causing a backslash to be printed? If it was being treated purely as a literal backslash, I would expect th
The documentation needs fixing. The HISTORY section of the man page has this to say: History expansions are introduced by the appearance of the historyexpansion character, which is ! by default. On
csh allows backslash to act as an escape character (that is, it is removed) when it precedes ! in a double-quoted string. Bash doesn't ... But if it doesn't, then why does bang not have its history-
I'm not sure what point you're trying to make here. Are you arguing that *printing* these backslash escapes is valid behavior here, and the reporter has merely misunderstood the shell rules? -- Eli S
The third release candidate of bash-5.1 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-5.1-rc3.tar.gz and from the bash-5.1-testing branch in the bash git repository (http://git.savan
The second release candidate of bash-5.1 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-5.1-rc2.tar.gz and from the bash-5.1-testing branch in the bash git repository (http://git.sava
My guess is that you're running into the fact that there are two types of quoting character. One quotes *any* character that follows it, and thus it never appears in "the output" unless it was double
The first release candidate of bash-5.1 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-5.1-rc1.tar.gz and from the bash-5.1-testing branch in the bash git repository (http://git.savan
Then why do they cause a difference in behaviour? Then why does “\!” act as “!” under any circumstances at all? Do you mean this sentence from section 9.3: “Only ‘\’ and ‘'’ may be
The first beta release of bash-5.1 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-5.1-beta.tar.gz and from the bash-5.1-testing branch in the bash git repository (http://git.savannah.
I find it adequate to set histchars to an empty string. -- Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com> == Author: Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Yes, this is where the semantics of historyexpansion clash with traditional shell behavior. Only single quotes inhibit historyexpansion. Unfortunately, this violates Posix and traditional sh behav