Re: Confused about how bash breaks input into words

2010-02-24 Thread Marc Herbert
Eric Blake a écrit :
 
 Another good reference is POSIX:
 http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03

A less rigorous and easier reading is the Guide to Unix Shell Quoting:

http://www.mpi-inf.mpg.de/~uwe/lehre/unixffb/quoting-guide.html#para:sh-input-interp







How to unsubscribe from bug-bash@gnu.org

2010-02-24 Thread Vikas Dubey
How to unsubscribe from bug-bash@gnu.org

-Vikas


  




Re: How to unsubscribe from bug-bash@gnu.org

2010-02-24 Thread Roman Rakus

On 02/24/2010 02:01 PM, Vikas Dubey wrote:

How to unsubscribe from bug-bash@gnu.org

-Vikas





   

Here: http://lists.gnu.org/mailman/listinfo/bug-bash
RR




Re: echo ^C

2010-02-24 Thread Greg Wooledge
On Tue, Feb 23, 2010 at 05:23:00PM -0500, Chet Ramey wrote:
 That capability (readline echoing the key that generated a signal if the
 ECHOCTL bit was set with stty) was not added until bash-4.0.  It's a
 settable variable in bash-4.1, so you may not want to rely on it.

... Ah, there it is.  In readline.

bind 'set echo-control-characters off'
echo 'set echo-control-characters off'  ~/.inputrc




Bash Ref Manual on tokenization omits consideration of expansions

2010-02-24 Thread Allen Halsey
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc-4
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' 
  -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' 
  -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
  -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS   -I.  
  -I/usr/src/bash-3.2.49-23/src/bash-3.2 
  -I/usr/src/bash-3.2.49-23/src/bash-3.2/include 
  -I/usr/src/bash-3.2.49-23/src/bash-3.2/lib   -O2 -pipe 
uname output: CYGWIN_NT-5.1 universi-c1eec2 1.7.0(0.218/5/3) 
  2009-12-04 17:08 i686 Cygwin
Machine Type: i686-pc-cygwin

Bash Version: 3.2
Patch Level: 49
Release Status: release

Description:

 This bug report against the Bash Reference Manual stems from a discussion 
 on bug-bash [1].

 The Bash Reference Manual's description of Shell Operation [2] omits 
 from its description of tokenization (Step 2) that the shell must 
 recognize expansion constructs.

 Step 2 says:

  [The shell] breaks the input into words and operators, obeying the 
  quoting rules described in Quoting. These tokens are separated by 
  metacharacters. Alias expansion is performed by this step (see 
  Aliases).

 Applying this tokenization description to a simple example:

  [...@host ~] $ echo The date is $(date +%Y-%m-%d)

 would result in this list of tokens:

  --- -
  echoword
  space metacharacter
  The word
  space metacharacter
  dateword
  space metacharacter
  is  word
  space metacharacter
  $   word
  (   metacharacter
  dateword
  space metacharacter
  +%Y-%m-%d word
  )   metacharacter


 A reading of POSIX re Shell Token Recognition [3] indicates that shell 
 tokenization respects substitution candidates intact. The list of tokens 
 is the simple example then become:

  --- -
  echoword
  space metacharacter
  The word
  space metacharacter
  dateword
  space metacharacter
  is  word
  space metacharacter
  $(date +%Y-%m-%d) word

[1] http://thread.gmane.org/gmane.comp.shells.bash.bugs/14377
or
http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00119.html

[2] http://www.gnu.org/software/bash/manual/bashref.html#Shell-Operation

[3]
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03


Repeat-By:


Fix:

 I recommend that the first sentence of Step 2 be appended with the 
 following:

  and keeping intact sequences of characters comprising expansions (see
   Shell Expansions).

Allen
--
Allen Halsey