info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mtools] amuFormat.sh in bash instead csh


From: David C Niemi
Subject: Re: [Mtools] amuFormat.sh in bash instead csh
Date: Mon, 14 May 2007 12:44:47 -0400 (EDT)

On Mon, 14 May 2007, Adam Tkac wrote:
In the end script has been completely rewritten (by Stepan Kasal, <address@hidden>). Could be POSIX-compatible now.

Regards, -A-

A few comments:

"if [ $# != 2 ]" does a string comparison. You should use a numeric comparison, i.e. "if [ $# -ne 2 ]"

When exiting for bad usage, I'd normally expect "exit 1", not "exit 0".

"cat <<-EOF" is really a very complicated and ugly way of doing something quite simple. Using echo on a multi-line text section enclosed in single quotes is more efficient.

Since $2 is taken from command-line user data, it should at least be put in double quotes when used (e.g. the mpartition, mformat, minfo, and mdir lines). Otherwise a user who supplies a $2 with a space in it can cause some major weirdness.

+-----------------------------------------------------------+
| David C Niemi  (Reston, VA, USA)  niemi at tuxers dot net |
+-----------------------------------------------------------+


reply via email to

[Prev in Thread] Current Thread [Next in Thread]