Search This Blog

2018-07-04

broken wings...

link=`readlink "${1}" || exit` ;
if [ -e link ] ; # already exists ?
then echo "$link" ; # echo it as is
# otherwise expand variables and sub-scripts
else eval echo "\"${link}\"" |
  # tilde to tilde
  { local h ; h=~ ; sed "s|~|$h|g" ; } ;
  # ... or tilde to $HOME
  # sed "s|~|$HOME|g" ;
fi ;

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.