Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Tom Buskey
Scripting non-bourne shell stuff with #!/bin/sh at the top *should* break. Even if /bin/sh is a link to bash/ksh that changes its behavior based on the link. If your code breaks, shame on you. You shouldn't use bashisms/kshisms in #!/bin/sh. If you want bash or ksh, use #!/bin/bash or

Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Ben Scott
On 10/1/07, Tom Buskey [EMAIL PROTECTED] wrote: Scripting non-bourne shell stuff with #!/bin/sh at the top *should* break. Ah, yes, maximum pain as a design goal. :-( If you want bash or ksh, use #!/bin/bash or #!/bin/ksh. What about an extension feature that exists in more than one

Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Tom Buskey
On 10/1/07, Ben Scott [EMAIL PROTECTED] wrote: On 10/1/07, Tom Buskey [EMAIL PROTECTED] wrote: Scripting non-bourne shell stuff with #!/bin/sh at the top *should* break. Ah, yes, maximum pain as a design goal. :-( What I'm saying is #!/bin/sh should run like #!/bin/sh. export

[ means test right? Maybe? (was: Re: GOTCHA in Ubuntu - broken shell)

2007-10-01 Thread Flaherty, Patrick
=Another example. This one is [was] my favorite; I think it was =the first one to bork on me. The error message was [is] so obscure =that for the past year I've lived with band-aiding each if =statement one at a time, just to have something which works. =(One uses if statements much more

Re: [ means test right? Maybe? (was: Re: GOTCHA in Ubuntu - broken shell)

2007-10-01 Thread Tom Buskey
On 10/1/07, Flaherty, Patrick [EMAIL PROTECTED] wrote: =The band-aid, by the way, was that = instead of == works. =(And how ugly is THAT? And how do you explain that to a student?) FYI, the correct operator is = and == is an extension of bash. == should not be used. I thought

Re: [ means test right? Maybe? (was: Re: GOTCHA in Ubuntu - broken shell)

2007-10-01 Thread Jeffry Smith
On 10/1/07, Tom Buskey [EMAIL PROTECTED] wrote: Here's the relevant bash (3.2.9) man page on Fedora 7: string == pattern True, if string matches pattern. Any part of pattern can be quoted to cause it to be matched as a string. With a successful

Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Chip Marshall
On October 01, 2007, Tom Buskey sent me the following: If you want bash or ksh, use #!/bin/bash or #!/bin/ksh. If it doesn't exist in /bin, put it there where it belongs. Coming from a primarily FreeBSD background, I'm against the idea of putting bash in /usr/bin. In my world, /usr is for

Re: [ means test right? Maybe? (was: Re: GOTCHA in Ubuntu - broken shell)

2007-10-01 Thread Tom Buskey
On 10/1/07, Jeffry Smith [EMAIL PROTECTED] wrote: On 10/1/07, Tom Buskey [EMAIL PROTECTED] wrote: Here's the relevant bash (3.2.9) man page on Fedora 7: string == pattern True, if string matches pattern. Any part of pattern can be quoted

Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Stephen Ryan
On Mon, 2007-10-01 at 10:30 -0400, Tom Buskey wrote: Thank goodness environments have converged a bit. /bin/perl, /bin/bash exist in Solaris, Linux, Cygwin, xBSD and (I think) MacOSX. /bin/bash is present in OSX, but not in the default FreeBSD install or the default DragonFly BSD install.

Re: GOTCHA in Ubuntu - broken shell

2007-10-01 Thread Bill McGonigle
On Oct 1, 2007, at 10:30, Tom Buskey wrote: What I'm saying is #!/bin/sh should run like #!/bin/sh. export VAR=value doesn't work in bourne shell. So if you put that in a bourne shell script with #!/bin/sh, then it should fail That seems to be the root cause of the problem, IMHO.

Re: GOTCHA in Ubuntu - broken shell [FLAMEBAIT]

2007-09-29 Thread Bruce Dawson
Bill Sconce wrote: Arrogant. Unbelievable. The side effects were reported during beta and still the developers did this. Clearly, they made a decision, and you (and a number of others) just don't like like it. The developer's justification appears to be because I think its best this way (My

Re: GOTCHA in Ubuntu - broken shell

2007-09-29 Thread Tyson Sawyer
On 9/28/07, Bill Sconce [EMAIL PROTECTED] wrote: (And remember to not trust Ubuntu. They don't think things through to the consequences. They don't listen, either. See below.) How about the consequences of using the syntax of one language and asking the shell/interpreter/compiler of a different

Re: GOTCHA in Ubuntu - broken shell

2007-09-29 Thread Steven W. Orr
On Friday, Sep 28th 2007 at 14:53 -, quoth Bill Sconce: =___ =Another example. This one is [was] my favorite; I think it was =the first one to bork on me. The error message was [is] so obscure =that for the past year I've lived with band-aiding each if

Re: GOTCHA in Ubuntu - broken shell

2007-09-29 Thread Ted Roche
Ben Scott wrote: Personally, I think the right thing to do is make bash the de facto standard on all *nix systems. We don't need this kind of headache. But others obviously disagree. Entropy wins again. But then, it always does. Always? Man, there ought to be a law :) -- Ted Roche

Re: GOTCHA in Ubuntu - broken shell

2007-09-29 Thread Fran Fadden
Ben Scott wrote: On 9/29/07, Tyson Sawyer [EMAIL PROTECTED] wrote: If you say '/bin/sh' then you should speak '/bin/sh'. If you are speaking '/bin/bash', then you should say, '/bin/bash'. It gets ugly in the other direction, too, BTW. Some people fall the habit of just putting

Re: GOTCHA in Ubuntu - broken shell

2007-09-29 Thread Ben Scott
On 9/29/07, Tyson Sawyer [EMAIL PROTECTED] wrote: If you say '/bin/sh' then you should speak '/bin/sh'. If you are speaking '/bin/bash', then you should say, '/bin/bash'. It gets ugly in the other direction, too, BTW. Some people fall the habit of just putting #!/bin/bash at the top of every

GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Bill Sconce
Hi, all - You may know this: Ubuntu's default shell isn't bash. [I grepped to see if anyone has mentioned the issue here before; it seems not. Apology if my post is a duplicate.] For months I've been seeing difficult-to-understand problems in shell scripts: syntax errors, bad substitution;

Re: GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Sarunas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bill Sconce wrote: Hi, all - You may know this: Ubuntu's default shell isn't bash. Only partially true. Installer/dpkg asks you whether you want dash (i.e./bin/sh - /bin/dash symlink). Sarunas Burdulis Dartmouth -BEGIN PGP SIGNATURE-

Re: GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Bill McGonigle
On Sep 28, 2007, at 14:53, Bill Sconce wrote: /bin/sh: Syntax error: Bad substitution I ran into this earlier, Oracle distributes: #!/bin/sh scripts with their installers that use bash functions and bork on Solaris's sh with substitutions. export FOO=bar even fails. They also

Re: GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Kevin D. Clark
Bill McGonigle [EMAIL PROTECTED] writes: So who has a tool that scans your scripts for bash-isms? dash -n your-script -- perhaps? Regards, --kevin -- GnuPG ID: B280F24E God, I loved that Pontiac. alumni.unh.edu!kdc -- Tom Waits

Re: GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Ben Scott
On 9/28/07, Bill McGonigle [EMAIL PROTECTED] wrote: So who has a tool that scans your scripts for bash-isms? grep -E . /path/to/my-script.sh ;-) -- Ben ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org

Re: GOTCHA in Ubuntu - broken shell

2007-09-28 Thread Bill Sconce
On Fri, 28 Sep 2007 15:31:13 -0400 Sarunas [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bill Sconce wrote: Hi, all - You may know this: Ubuntu's default shell isn't bash. Only partially true. Installer/dpkg asks you whether you want dash (i.e./bin/sh -