Re: [Help-bash] Best way to remove trailing '/' from a path?
From:
Eric Blake
Subject:
Re: [Help-bash] Best way to remove trailing '/' from a path?
Date:
Mon, 20 Apr 2015 15:05:46 -0600
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 04/20/2015 03:00 PM, Chris F.A. Johnson wrote:
>> dirname -- "$VAR/."
>
> $ var=q/////////
> $ dirname -- "$VAR/."
> /
Umm, $var and $VAR are different entities. dirname -- "$var/." results
in the desired "q".
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc Description: OpenPGP digital signature