Re: Confused about how bash breaks input into words

2010-02-23 Thread DennisW
On Feb 23, 8:41 pm, Allen Halsey wrote: > Eric Blake redhat.com> writes: > > > > > But you missed that: > > > $(date +'%Y-%m-%d') > > > is an entire word (basically, an unquoted $ character consumes until the > > end of the shell substitution, command substitution, or arithmetic > > substitution,

Re: Confused about how bash breaks input into words

2010-02-23 Thread Allen Halsey
Eric Blake redhat.com> writes: > > But you missed that: > > $(date +'%Y-%m-%d') > > is an entire word (basically, an unquoted $ character consumes until the > end of the shell substitution, command substitution, or arithmetic > substitution, and that entire scan becomes part of the current word

Re: Namespace problem with pipe into a braced group

2010-02-23 Thread Chet Ramey
On 2/23/10 4:23 AM, t...@icada.com wrote: > Description: > I would have expected the output to be 2 in both cases. My mistake or > yours? :-) > > Repeat-By: > a=1; echo foo;{ a=2; }; echo $a # output: 2 > a=1; echo foo|{ a=2; }; echo $a # output: 1 Yours. Pl

Re: Confused about how bash breaks input into words

2010-02-23 Thread Chris F.A. Johnson
On Tue, 23 Feb 2010, Eric Blake wrote: > According to Allen Halsey on 2/23/2010 3:50 PM: > > Hi, > > > > I'm trying to understand bash's parsing model. > > > > I read in the manual that the shell "breaks the input into words and > > operators, > > obeying the quoting rules described in Quoting.

Re: Namespace problem with pipe into a braced group

2010-02-23 Thread Chris F.A. Johnson
On Tue, 23 Feb 2010, t...@icada.com wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 > -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 > Compilation CFLAGS: -DPROGRAM='bash' -DCONF

Re: Confused about how bash breaks input into words

2010-02-23 Thread Eric Blake
According to Allen Halsey on 2/23/2010 3:50 PM: > Hi, > > I'm trying to understand bash's parsing model. > > I read in the manual that the shell "breaks the input into words and > operators, > obeying the quoting rules described in Quoting. These tokens are separated by > metacharacters." Anoth

Namespace problem with pipe into a braced group

2010-02-23 Thread tobi
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MAC

Confused about how bash breaks input into words

2010-02-23 Thread Allen Halsey
Hi, I'm trying to understand bash's parsing model. I read in the manual that the shell "breaks the input into words and operators, obeying the quoting rules described in Quoting. These tokens are separated by metacharacters." Taking this simple example: [...@host ~] $ echo The date is $(date +'

Re: echo ^C

2010-02-23 Thread Chet Ramey
> Within the bash-completion testsuite, we're trying to synchronize in > between test cases using the string "^C", output by bash on receiving a > SIGINT. > This works fine for bash >= 4 (typing ^C is echoed as "^C"), but on > bash-3 typing ^C is echoed as a newline. Is there a setting to make > b

Re: Variable getopts lost

2010-02-23 Thread Mart Frauenlob
On 23.02.2010 20:55, Daniel Bunzendahl wrote: > Am Dienstag, 23. Februar 2010 20:45:31 schrieb Greg Wooledge: >> On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote: >>> if [ !$LSEITE ]; then >> >> You want: if [ ! "$LSEITE" ] > > this dosn't work. > > But I earsed the if-loop. And

Re: echo ^C

2010-02-23 Thread Greg Wooledge
On Tue, Feb 23, 2010 at 10:23:38PM +0100, Freddy Vulto wrote: > Within the bash-completion testsuite, we're trying to synchronize in > between test cases using the string "^C", output by bash on receiving a > SIGINT. > This works fine for bash >= 4 (typing ^C is echoed as "^C"), but on > bash-3 typ

echo ^C

2010-02-23 Thread Freddy Vulto
Within the bash-completion testsuite, we're trying to synchronize in between test cases using the string "^C", output by bash on receiving a SIGINT. This works fine for bash >= 4 (typing ^C is echoed as "^C"), but on bash-3 typing ^C is echoed as a newline. Is there a setting to make bash-3 echo "

Re: Variable getopts lost

2010-02-23 Thread Daniel Bunzendahl
Am Dienstag, 23. Februar 2010 20:45:31 schrieb Greg Wooledge: > On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote: > > if [ !$LSEITE ]; then > > You want: if [ ! "$LSEITE" ] this dosn't work. But I earsed the if-loop. And it works. (dont overwrite LSEITE) But I need this check i

Re: Variable getopts lost

2010-02-23 Thread Ken Irving
On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote: > ... > if [ !$LSEITE ]; then > LSEITE=$(pdfinfo $pdf | grep Pages: | sed -e 's/Pages:[[:space:]]//g') > echo "-l automatisch auf $LSEITE gesetzt" > fi > ... > > In the last if-loop LSEITE will be set if LSEITE isn't set. > This

Re: Variable getopts lost

2010-02-23 Thread Greg Wooledge
On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote: > if [ !$LSEITE ]; then You want: if [ ! "$LSEITE" ] There are probably more errors. This is just the line you mentioned in particular as not working.

Re: Variable getopts lost

2010-02-23 Thread pk
Daniel Bunzendahl wrote: > My question wasn't fokused on my wrong script. I think there is something > wrong or limited by the System... > Maybe you can give me a tip I should search for... You've got it already...either invoke the script with its name (not through bash), or use bash -- etc.

Re: Variable getopts lost

2010-02-23 Thread Daniel Bunzendahl
Am Dienstag, 23. Februar 2010 12:50:41 schrieb Pierre Gaston: > On Tue, Feb 23, 2010 at 1:14 AM, DanielBu wrote: > > Hello all, > > > > I get crazy with getopts: > > Some Times my script (500 Lines) don't take input parameters like this: > > It's really impossible to make a guess with a report as

Re: Variable getopts lost

2010-02-23 Thread Pierre Gaston
On Tue, Feb 23, 2010 at 1:14 AM, DanielBu wrote: > > Hello all, > > I get crazy with getopts: > Some Times my script (500 Lines) don't take input parameters like this: It's really impossible to make a guess with a report as vague as that.

Re: Variable getopts lost

2010-02-23 Thread Mart Frauenlob
On 23.02.2010 00:14, DanielBu wrote: > > Hello all, > > I get crazy with getopts: > Some Times my script (500 Lines) don't take input parameters like this: > > /bin/bash pdf2media.sh -f 9 -l 104 Document.pdf > > the script reads -f 9 and Documents.pdf but missing -l 104 > > It did work for a l