Re: [Help-bash] Best way to remove trailing '/' from a path?
From:
Peng Yu
Subject:
Re: [Help-bash] Best way to remove trailing '/' from a path?
Date:
Fri, 10 Apr 2015 23:00:58 -0500
On Fri, Apr 10, 2015 at 10:44 PM, Chris F.A. Johnson
<address@hidden> wrote:
> On Fri, 10 Apr 2015, Peng Yu wrote:
>
>> Hi, ${VAR%%+(/)} has been suggested here. But it is not robust if $VAR
>> is just a bunch of slashes. Does anybody have a robust yet succinct
>> implementation?
>
>
> ${var%/}
I should have said to remove all trailing slashes.
This does not work for something like x////.
--
Regards,
Peng