Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 292 Bytes

readlink.md

File metadata and controls

18 lines (11 loc) · 292 Bytes

readlink

Coreutils.

Get target of symlink.

Not POSIX, even though POSIX defines a C function with that name.

touch a
ln -s a b
ln -s b c

[ "$(readlink c)" = 'b' ] || exit 1
[ "$(readlink b)" = 'a' ] || exit 1

Recursive:

[ "$(readlink -f c)" = 'a' ] || exit 1