shell scripts and comand arguments
frank at esperance-linux.co.uk
Wed Jun 4 17:51:29 BST 2003
On Wed, Jun 04, 2003 at 12:19:25AM +0100, Geraint A Edwards wrote:
> Frank Shute <frank at esperance-linux.co.uk> said
> (on Tue, Jun 03, 2003 at 07:57:34PM +0100):
> > if [[ $1 = @(-w|-t|-thmbw|-thmbt) ]] && [[ $2 = *.jpg ]] && [[ $3 = *.jpg ]];
> Um, why not just
> if [[ $1 = @(-w|-t|-thmbw|-thmbt) && $2 = *.jpg && $3 = *.jpg ]];
Because checking the 2nd & 3rd args was an afterthought & it worked OK
like that. ie. It's an ugly hack like most of my scripts ;)
> (after many years of using csh/tcsh, I've never looked back
> after moving over to sh/ksh/bash - and that was years ago too!)
I've avoided csh as I've always thought it made more sense to use a
shell that was bourne shell compatible. It didn't used to have much in
the way of editing features too (although i think this has changed
If I'm writing system scripts I try & use vanilla sh or perl. Stuff
for myself, I don't really care.
I started with bash but am now a pdksh devotee. I picked up ksh
because I thought that one day I might face a Sun box with just the
default shell on it (never have of course!) but I've stuck with it
although I rarely use it's extended features; I find it a nice shell
for user interaction.
One day I wouldn't mind fiddling around with tcsh and zsh just to see
how they approach things.
Since the shell is a tool (along with my editor) that I use everyday I
guess it makes sense to be choosy and pick one that you're happy with.
I think a lot of users tend to just stick with what comes as a default
(certainly in the Linux world).
Tel: 01423 323019
PGP keyID: 0xC0B341A3
The Arses of Evil: Bush, Cheney, Rumsfield, Blair
More information about the Ukfreebsd