[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug on basename
From: |
Pádraig Brady |
Subject: |
Re: bug on basename |
Date: |
Wed, 14 Jan 2009 13:56:31 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Leonardo wrote:
> basename does not check if the file exists.
That's expected behaviour.
Use the test command to check file existence:
input=Desktop/okidoki
file=$(test -e "$input" && basename "$input")
[ "$file" ] && echo "$file" || echo "missing"
Pádraig.
- bug on basename, Leonardo, 2009/01/14
- Re: bug on basename,
Pádraig Brady <=