[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ?maybe? RFE?... read -h <symlink>?
From: |
felix |
Subject: |
Re: ?maybe? RFE?... read -h <symlink>? |
Date: |
Mon, 6 Sep 2021 08:35:35 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, Sep 05, 2021 at 11:54:05PM -0400, Lawrence Velázquez wrote:
> On Sun, Sep 5, 2021, at 11:11 PM, Dale R. Worley wrote:
> > > ... I was wondering, is there a way for bash to know where the
> > > symlink points (without using an external program)?
>
> The distribution ships with a "realpath" loadable builtin, FWIW.
> bash-5.1$ enable -f /opt/local/lib/bash/realpath realpath
> bash-5.1$ realpath /usr/bin/cc
> /usr/bin/clang
I think this answer the need, but using this to populate a variable implie
anyway a fork.
realPathArray=$(realpath /bin/sh /usr/bin/X)
It would be nice if builtins intended to produce *answer* use more or less
common switch like `printf -v` behaviour.
usage: realpath [-a array] [-csv] pathname [pathname...]
options: -a NAME assign the output to shell array NAME rather than
display it on the standard output
-c check whether or not each resolved path exists
-s no output, exit status determines whether path is valid
-v produce verbose output
--
Félix Hauri - <felix@f-hauri.ch> - http://www.f-hauri.ch
- ?maybe? RFE?... read -h <symlink>?, L A Walsh, 2021/09/04
- Re: ?maybe? RFE?... read -h <symlink>?, Greg Wooledge, 2021/09/04
- Re: ?maybe? RFE?... read -h <symlink>?, Dale R. Worley, 2021/09/05
- Re: ?maybe? RFE?... read -h <symlink>?, Lawrence Velázquez, 2021/09/05
- Re: ?maybe? RFE?... read -h <symlink>?,
felix <=
- Re: ?maybe? RFE?... read -h <symlink>?, Alex fxmbsw7 Ratchev, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, Alex fxmbsw7 Ratchev, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, Greg Wooledge, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, Alex fxmbsw7 Ratchev, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, felix, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, L A Walsh, 2021/09/06
- Re: ?maybe? RFE?... read -h <symlink>?, Lawrence Velázquez, 2021/09/06