[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Is there a way to combine $( and ${%}?
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Is there a way to combine $( and ${%}? |
Date: |
Fri, 8 Dec 2017 08:47:36 -0500 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Fri, Dec 08, 2017 at 07:22:33AM -0600, John McKown wrote:
> Works. But if the OP wants another technically correct, but worse, answer,
> there is always:
>
> x=$(readlink -e "$0" | sed -r 's|^(.*)/[^/]*$|\1|' )
Gotta love seeing one nonportable command with a raising with a second
nonportable command.
Also, as long as I'm in this thread:
https://mywiki.wooledge.org/BashFAQ/028