Re: ver_linux script

From: Tim Coleman (tim@beastor.mine.nu)
Date: Wed Mar 15 2000 - 15:31:41 EST


On Wed, Mar 15, 2000 at 04:27:35PM +0000, Riley Williams wrote:
> Hi Tim.
>
> The cure for that would clearly be to use a PATH statement that
> appended the requisite directories on to the END of the existing
> one, rather than on to the START as the previous version did, and
> as you have also done. Otherwise, we lose the assurance that the
> command nearest in the user's path will be used.

Right. I just copied the line verbatim from the previous
version.
>
> > By robust, I mean checking to make sure files exist before
> > cat-ing them, and so on.
>
> The problem with that lies in the fact that this is a script that
> is designed to be sourced rather than run. That leaves us
> vulnerable to the vagarities of the shell the user happens to be
> using - if they're running bash then we're fine, but if they
> happen to be running csh or tcsh then...
>
> Basically, the ONLY way that script could really be made robust
> would be to rename it as linux_ver and creat the following as
> ver_linux in its place:

Ick. Maybe it would be best to just avoid bashisms at all.
Forget what I said about checking for the existence of files.

My brain hurts.

Tim



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:17 EST