On 4/14/07, Rick Funderburg <[EMAIL PROTECTED]> wrote:
On 4/14/07, Chuck Esterbrook <[EMAIL PROTECTED]> wrote:
> In a bash script, I can use $0 for the current "path/name" of the
> script. Can I get just the path of the script? Is there a quick way to
> strip off the script name for example?
>
> When echo $0 gives:
>     /foo/bar/my-script
> I need "/foo/bar" or "/foo/bar/"

You can use the dirname command to get the directory and the basename
command to get the command.

Thanks everyone. I didn't know that the Python names
(os.path.dirname(s)) were modeled after the command line, although I'm
not surprised. (Or it *could* be coincidence.)

-Chuck

--
[EMAIL PROTECTED]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to