Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Bashing away at Unix
- Date: Fri, 14 Mar 2008 23:35:56 +0900
- From: Dave Brown <dagbrown@example.com>
- Subject: Re: [tlug] Bashing away at Unix
- References: <47D7A519.70409@imaginatorium.org> <20080312101925.5b996fe6.gstewart@bonivet.net> <ed10ee420803140059s7f2c8398p9f06ae4c173f6f69@mail.gmail.com> <78d7dd350803140132x36ca0133m915dd9dee59b24b7@mail.gmail.com> <87y78lskxz.fsf@uwakimon.sk.tsukuba.ac.jp> <78d7dd350803140257t3a3fdbbat913b079a795a425a@mail.gmail.com> <ed10ee420803140322t5a6aeb95tcdece78abbc6dd62@mail.gmail.com> <d8fcc0800803140409j7f824076v2a5f47c5ad4e7ede@mail.gmail.com> <20080314125741.GB41009@mail.scottro.net>
- User-agent: Mutt/1.5.17 (2007-11-01)
On Fri, Mar 14, 2008 at 08:57:41AM -0400, Scott Robbins wrote: > On Fri, Mar 14, 2008 at 08:09:58PM +0900, Josh wrote: > > On 14/03/2008, SL Baur <steve@example.com> wrote: > > > > > Yes. When zsh is invoked as sh, it turns off *all* zsh extensions and > > > behaves as a conformant POSIX shell. > > > > I don't believe in using bash-isms in my shell scripts, which is why I write: > > > > #!/bin/sh > > > > and not > > > > #!/bin/bash > > Unfortunately, despite the claims of the man page, it's still often not > POSIX compliant. The POSIX definition of "/bin/sh" is a lot closer to ksh than most UNIX's actual /bin/sh actually comes. When I write a shell script that starts with #!/bin/sh, I set my baseline a lot lower than is probably really necessary, because I believe in playing it safe rather than sorry. To wit: I expect absolutly no ${variable}:modifier tricks to work ever. I expect [ to be a command, possibly running as a separate process. I expect [[ to not work ever. I expect $(( and $[ not not work at all. If I want that, I use expr. I expect $( not to work at all either. Basically, #!/bin/sh makes me set the bar REALLY REALLY low. Doing so has not done me any damage yet. On the other hand, my interactive shell on my own home box is the very latest version of zsh. When writing zsh scripts that I know will be running in the latest version of zsh, I just go nuts, and use every last convenience that zsh cares to offer me. And, man, does it ever feel awesome to do that. Kind of like programming in Ruby 1.9 after being stuck with an ancient awk for years and years. --Dave
- Follow-Ups:
- Re: [tlug] Bashing away at Unix
- From: SL Baur
- Re: [tlug] Bashing away at Unix
- From: Josh Glover
- References:
- [tlug] Bashing away at Unix
- From: Brian Chandler
- Re: [tlug] Bashing away at Unix
- From: Godwin Stewart
- Re: [tlug] Bashing away at Unix
- From: SL Baur
- Re: [tlug] Bashing away at Unix
- From: Nguyen Vu Hung
- Re: [tlug] Bashing away at Unix
- From: Stephen J. Turnbull
- Re: [tlug] Bashing away at Unix
- From: Nguyen Vu Hung
- Re: [tlug] Bashing away at Unix
- From: SL Baur
- Re: [tlug] Bashing away at Unix
- From: Josh Glover
- Re: [tlug] Bashing away at Unix
- From: Scott Robbins
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Bashing away at Unix
- Next by Date: [tlug] Re: recursively printing html Howto's: Solution
- Previous by thread: Re: [tlug] Bashing away at Unix
- Next by thread: Re: [tlug] Bashing away at Unix
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links