Quote:
Originally posted by unSpawn
if its executable and ure in /etc/rc.d/init.d prepend "./" , else gotta prepend the whole path.
|
What unspawn is pointing out, is that for security reasons, the current directory (ie. the "." that shows up in a directory listing you get from an ls -la) is not in the path. Thus any program or script you try and execute from the directory which contains that program, will not run, because the os can't find it. This is very different from DOS or NT CMD behavior. Unix basically can only find files that are in it's path, or which you explicitly specify their location in an absolute or relative way.
In order to override this behavior you can tell the shell to "look for the file in the current directory, by prepending "./" to the name. The . indicates the current directory, so basically you're specifying an explicit path to the file of current directory /somefile.
This is no different than if you were in another directory and specified the fully qualified filepath ie, you are in /etc and
type /etc/rc.d/init.d/network restart
Thus if you're in /etc/rc.d/init.d/ and want to run the network script, you should type
./network restart