Hi,

I want its full pathname using 'dirname', but it will give me
unexpected result on some Linux or Bash versions.

Qian

On 7/11/06, Dave Rutherford <[EMAIL PROTECTED]> wrote:
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
> In some Linux, it will print "/tmp/script.sh", while in other, it will
> print "script.sh" only. Which is wrong? If both are fine, is there any
> better way to make it portable?

Which do you want?  (Both are fine.)  If you want 'script.sh',
use 'basename' or the Bash equivalent, which I think is '${0##*/}'.
The canonical path would be a bit trickier.

Dave



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to