Re: /usr/src/linux/scripts/ver_linux prints out incorrect info when "ls"

Ishikawa (ishikawa@yk.rim.or.jp)
Tue, 06 Feb 2001 01:15:01 +0900


Peter Samuelson wrote:

> [Ishikawa]
> > I just noticed that running
> >
> > . /usr/src/linux/script/ver_linux
> >
> > prints out strange libc version
> [...]
> > I found that if the command "ls" is aliased to "ls -aF"
>
> So ... don't use '.' to execute scripts. If there is some
> documentation somewhere that told you to do this, please notify the
> author that it is wrong.
>
> sh scripts/ver_linux
>

This is a good observation.

I have no idea why I invoked ver_linux using "." : I must have
seen it somewhere and just followed it somehow.

Hard to tell where I have seen. I must have seen it in the last few
days.

Here is one URL where "." is used, but this was not where I saw the
usage.

http://oss.sgi.com/projects/devfs/mail/devfs/msg00261.html

I have found the same problem cropped up in the kernel mailing list
before.

http://uwsg.iu.edu/hypermail/linux/kernel/0003.1/0898.html

The above thread showed that non-other than Alan Cox also chimed in the
thread.

So there must have been a reason to let people try "." for
invoking /usr/src/linux/scripts/ver_linux.

One theory might be that, as a root, people may run
# ./ver_linux (under scripts directory).

And then, when they try to show what they did, they may
create a report showing the FULL path name of the scripts so that
there is no mistaking ver_scripts for something else.
And in doing so, somebody might have forgotten to remove the
leading "."
#./usr/src/linux/scripts/ver_linux
Somebody eles looked at the above and "figured" that the
leading "./" is a typo and thus corrects it to ". /"
and now we have
#. /usr/src/linux/scripts/ver_linux

Anyway, I have found another libc version output
in somebody's post. The poster must have similar problem as I did.
(See at the end for ver_linux output result. )
http://www.uwsg.indiana.edu/hypermail/linux/kernel/9906.3/0990.html

So in any case, I think protecting the
ver_linux from strange interaction of various
shell features might be a good idea after all.

(I was not convinced why "sh /usr/src/linux/scripts/ver_linux" works
since /bin/sh is a symlink to bash in my setup and it seems that
my ./bashrc includes the ls alias. But when I tried it, it works. )

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