Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Greg Wooledge
On Thu, Feb 04, 2010 at 11:54:51PM -0600, Evan Driscoll wrote: > Why not make Bash consider \r\n a legitimate line ending? What possible > reason could there be for treating carriage return characters as it does > now? Well, the most literal reason is that the shebang (#!/program) line will not

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Eric Blake
According to Jan Schampera on 2/4/2010 10:39 PM: > drisc...@cs.wisc.edu schrieb: > >> Some of the time, using CRLF line endings cause syntax errors >> in Bash scripts ("unexpected end of file"). >> >> This problem shows up on Bash 4.1 on Linux, Bash 3.2 on Linux, >> and Bash 3.

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Marc Herbert
Jan Schampera a écrit : > Moreover, POSIX talks about "" here, which is a \n. Though I > didn't read through all the rationales, I just took a quick look, maybe > it's not limited to \n. '\n' can be two characters outside of POSIX, see "man fopen". - It would feel good to use C

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Evan Driscoll
[This is an combination of a couple of replies to the various emails since last evening.] Pierre Gaston wrote: cygwin's bash is patched and provides a special igncr shopt option. try shopt -s igncr And with the ability to pass options to Bash on invocation with -o, this provides a better solu

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Jan Schampera
Evan Driscoll schrieb: > Then, many programs don't handle them per se, but *not* handling them > doesn't cause much problem. grep, cat, and echo probably fall in this > category. Bash doesn't handle it. It's a character like 'A' or 'B'. It causes problems :) J.

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Andreas Schwab
Jan Schampera writes: > It's a character like 'A' or 'B'. 'A' and 'B' are letters, $'\r' is whitespace. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Error when script uses CRLF line endings w/ if stmt

2010-02-05 Thread Jan Schampera
Andreas Schwab schrieb: >> It's a character like 'A' or 'B'. > > 'A' and 'B' are letters, $'\r' is whitespace. Yes... :)

command not put into history if it starts with space

2010-02-05 Thread Paul Stansell
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKA

Re: command not put into history if it starts with space

2010-02-05 Thread Mike Frysinger
On Friday 05 February 2010 05:07:46 Paul Stansell wrote: > When using the bash shell in an xterm or rxvt terminals at least, > commands executed which start with a space, eg " ls" are not added to > the command line history and so are not accessible by ctrl-p. this is by design -mike signature.a

Re: command not put into history if it starts with space

2010-02-05 Thread DennisW
On Feb 5, 4:07 am, Paul Stansell wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i386 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' > -DCONF_