[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Removing last directory from path
From: |
tolugboji |
Subject: |
Removing last directory from path |
Date: |
Fri, 15 Oct 2021 01:59:24 +0000 |
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, October 15th, 2021 at 1:29 AM, Chris F.A. Johnson
<chris@cfajohnson.com> wrote:
> On Fri, 15 Oct 2021, tolugboji via wrote:
>
> > I have a path gmtbin, and would like to remove the /bin at the end.
> >
> > gmtbin="/usr/local/bin/gmt/bin"
>
> binless=${gmtbin%/bin}
Right, I was using ${gmtbin/\/bin/}, which was removing the two /bin.