[X-Unix] Hiding apps from the command line

Stroller MacMonster at myrealbox.com
Fri Mar 26 09:29:02 PST 2004


On Mar 26, 2004, at 1:37 pm, Eugene Lee wrote:

> Another problem altogether...  A part of me wants to fix this by
> introducing another command option (-x) to represent this logic, which
> changes the former case to "hide -o -x appname".  However, there's a
> part of me that thinks this is overkill and is complicating an 
> otherwise
> simple shell script.
>
> Thoughts?  What do other Unix folks think?

I think that as soon as you start adding flags & multiple options to 
scripts, they're no longer "simple". Basically, I think that doing so 
is asking for trouble - although it might  be a great learning 
experience, you may find that the script grows disproportionally with 
each option you add. What about hiding 2 apps..? What about hiding all 
but 2..? What if (as I mentioned in another posting) one of those apps 
has a filename beginning with "-"..?

I reckon I'm my modest little shell scripts are starting to get pretty 
flashy now (well, all things are relative, eh?), but I've so far 
avoided this sticky question. I find that 90% of the time I spend 
writing a script is experimentation & checking that things work, but 
that 90% of the content is setting up variables for a final one-line 
pipe. About half the body of the script is error-checking [1].

Stroller.



[1] This is not contradictory with the statement that 90% is setting up 
variables, because I use a lot of constructs like 'if [ -z $foo ]; then 
$bar="--filename $grunt"; else $bar="-o stdin"; fi'.



More information about the X-Unix mailing list