Created
December 7, 2022 16:26
-
-
Save for2ando/fc01f19cc124f64b15ca7b4ede908085 to your computer and use it in GitHub Desktop.
A recursive version of readlink command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for arg; do | |
name="$arg" | |
oldname="$arg" | |
while name=$(readlink "$name"); do | |
oldname="$name" | |
done | |
echo $oldname | |
done | |
unset name oldname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment