Last active
October 24, 2018 07:54
-
-
Save photonxp/f262f24e0557fa85675ff73607add1e6 to your computer and use it in GitHub Desktop.
Make links in current working directory. A "ln -s" wrapper.
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
#!/bin/bash | |
# How can we eat the fish any more once we can read their minds? -- The dolphin lady | |
# Purpose: | |
# Make multiple links in current working directory. A "ln -s" wrapper. | |
# Usage: | |
# lns_multi_cwd.bash lnk_target_path_1 lnk_target_path_2 ... | |
# lns_multi_cwd.bash /path/dir/* | |
for fpath_target_raw in "$@" | |
do | |
fpath_target="$(echo $fpath_target_raw)" | |
printf "$fpath_target" | grep '/' | |
if [ 0 -eq $? ] | |
then | |
fpath_target_tail="${fpath_target##*/}" | |
else | |
fpath_target_tail="$fpath_target" | |
fi | |
ln -s "$fpath_target" "$fpath_target_tail" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment