let's say the scriptname is myscript
. It's a symbolic link to thescript_1.91.sh
Is there a way to get the name of the link destination? An example: I want to write in a logfile
cat <<EOF
#########################
`basename $0`
`date -R`
#########################
EOF
$0 holds the name of the file argument to the subshell, that is "myscript"
Is there a way to get the name of the link-destination here?
readlink
– steeldriver Jun 29 '18 at 17:03