[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: |
Wed, 28 Mar 2012 18:25:33 -0000 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: equivalent of Linux readlink -f in pure bash?,
Stephane CHAZELAS <=