[plug] Questions for information
Richard Henry
r.henry at murdoch.edu.au
Sun May 5 13:58:42 WST 2002
> More of a question in a similar vain than a response (hope
> you don't mind
> James :)...I was just wondering if anyone could tell me why
> sometimes a
> script or executable can be run simply by entering it's name
> (while in the
> same dir) and yet another has to have it's complete address
> to run (once
> again, even when in the same dir).
>
Are you the same user in both cases? If not, it's probably to do with your
PATH environment (echo $PATH).
If your path contains '.' (without the ''), it means "the current
directory". As such, you can be in a directory and type the name of an
executable file there, and it will run. It is relatively common for a
normal user account to have '.' in their path.
You normally wouldn't have it in the root users path though, due to security
concerns (eg: a rogue user puts a script in his home directory that wipes
the harddrive, and symlinks 'ls' and 'cd' to it - root user enters the
directory, types 'ls' and *boom*).
BTW, when in the same directory, you don't have to type the full address to
run something - just put ./ before the name, ie:
./myScript
where myScript is the file you want to run.
Rich.
More information about the plug
mailing list