bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: equivalent of Linux readlink -f in pure bash?


From: Stephane CHAZELAS
Subject: Re: equivalent of Linux readlink -f in pure bash?
Date: Tue, 9 Aug 2011 15:54:43 +0100
User-agent: slrn/pre1.0.0-18 (Linux)

2011-08-09, 09:50(-04), Steven W. Orr:
[...]
> *) To remove the trailing slashes, instead of
>
>              while [[ $file == */ ]]
>              do
>                  file=${file%/}
>              done
>
>              file=${file##*/}    # file name
>
> just say
>           file="${file%${file##*[!/]}}"
[...]

            file=${file%"${file##*[!/]}"}

Same problem with "/" being changed to "" though.

-- 
Stephane



reply via email to

[Prev in Thread] Current Thread [Next in Thread]