Re: How to deal with space in command line?

2010-09-20 Thread Greg Wooledge
On Sat, Sep 18, 2010 at 09:16:46PM -0500, Peng Yu wrote: > Hi, > > stat --printf "%y %n\n" `find . -type f -print` Chris and Pierre already helped with this specific example. I'd like to address the more general case. In the original design of the Unix shell, in many ways and places, it's quite

Re: How to deal with space in command line?

2010-09-20 Thread Eric Blake
On 09/20/2010 07:14 AM, Greg Wooledge wrote: ... which uses three bash extensions and one BSD/GNU extension. To the best of my knowledge, the task is completely impossible in strict POSIX. Impossible in strict POSIX 2008. But the Austin Group (the people that develop the POSIX standard) is a

Re: How to deal with space in command line?

2010-09-20 Thread Marc Herbert
Le 20/09/2010 14:14, Greg Wooledge wrote: > In the original design of the Unix shell, in many ways and places, > it's quite apparent that the designers never really intended to handle > filenames that contain whitespace. ... while at the same time allowing almost any character to be part of a fi

"gitk &" closes parent bash upon exit

2010-09-20 Thread Illia Bobyr
Configuration Information: 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_PI

Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.

2010-09-20 Thread Linda Walsh
Pierre Gaston wrote: Just quote the spaces and not the special chars: Pierre, your suggestion doesn't help clean up strings used inside of double brackets. I wanted to avoid the need for multiple backslashes in an expression as it makes the expression less readable and more error prone.

Re: How to deal with space in command line?

2010-09-20 Thread Chet Ramey
On 9/20/10 10:30 AM, Marc Herbert wrote: > Le 20/09/2010 14:14, Greg Wooledge wrote: >> In the original design of the Unix shell, in many ways and places, >> it's quite apparent that the designers never really intended to handle >> filenames that contain whitespace. > > ... while at the same tim

Re: How to deal with space in command line?

2010-09-20 Thread Linda Walsh
Peng Yu wrote: Hi, stat --printf "%y %n\n" `find . -type f -print` I could use the following trick to stat each file separately. But I prefer to stat all the files at once. I'm wondering if there is any easy way to converted the strings returned by find if there are special characters such as

Re: "gitk &" closes parent bash upon exit

2010-09-20 Thread Eric Blake
On 09/20/2010 12:44 PM, Illia Bobyr wrote: It may be a Cygwin specific problem. Approximately at the time the problem appeared cygwin.dll was also updated. This is a known cygwin problem, caused by the fact that cygwin tcl is not cygwin-aware, which makes cygwin have a tough time knowin

Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.

2010-09-20 Thread Pierre Gaston
On Mon, Sep 20, 2010 at 10:28 PM, Linda Walsh wrote: > > > Pierre Gaston wrote: > >> Just quote the spaces and not the special chars: > > Pierre, your suggestion doesn't help clean up strings used inside of double > brackets.  I wanted to avoid the need for multiple backslashes in an > expression

pwd does not update when path component is renamed

2010-09-20 Thread Krzysztof Żelechowski
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc -I/usr/src/packages/BUILD/bash-4.1 -L/usr/src/packages/BUILD/bash-4.1/../readline-6.1 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MAC

Re: pwd does not update when path component is renamed

2010-09-20 Thread Jan Schampera
Krzysztof Zelechowski wrote: Description: The text of pwd and the value of $PWD return a cached value, regardless of the actual current path. Repeat-By: mkdir '-p' 'a' && cd 'a' && mv '../a' '../b' && enable '-n' 'pwd' && builtin 'pwd' && pwd Fix: cd '-P' '.' I thi

Re: pwd does not update when path component is renamed

2010-09-20 Thread Bob Proulx
Krzysztof Żelechowski wrote: > The text of pwd and the value of $PWD return a cached value, > regardless of the actual current path. > mkdir '-p' 'a' && cd 'a' && mv '../a' '../b' && enable '-n' 'pwd' && > builtin 'pwd' && pwd > > Fix: > cd '-P' '.' That is just the way that thin

Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.

2010-09-20 Thread Linda Walsh
Pierre Gaston wrote: what about: [[ foo =~ bar && baz ]] Should bar && baz be considered as one regexp? if not, how would you write a regexp matching `foo && baz' ? or `foo && baz.*' ? Use parentheses to disambiguate ambiguous cases? if yes how would you do and and with a r