(46 lines)
1 #!/bin/sh2 # Symlink is a small script to basically make `ln -s` less of a pain in the ass.3 # This script automagically figures out which direction you mean, and allows you to4 # pass in two actual paths (which works with tab completion) and specify if you mean5 # to make a relative or absolute link (relative is assumed by default).6 #7 # Usage: symlink [-a|--absolute] path1 path28 #13 fi18 fi21 printf "Both \x1b[1m%s\x1b[0m and \x1b[1m%s\x1b[0m already exist. Please delete one of them before proceeding.\n" "$@"25 choice=$(printf "%s\n" "1. $1 -> $2" "2. $2 -> $1" "3. Whoops that was a mistake" | fzy -p "Which do you mean? " | awk -F. '{print $1}' || exit 1)33 else35 fi39 else41 fi45 echo