From: Steven Baltakatei Sandoval Date: Wed, 13 Jan 2021 22:51:33 +0000 (+0000) Subject: edit(unitproc:bkmvln):Customize X-Git-Tag: 0.3.0~3 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/bf5f3979077842c0107046ccf15fa9fba7cf8fad?ds=sidebyside;hp=--cc edit(unitproc:bkmvln):Customize --- bf5f3979077842c0107046ccf15fa9fba7cf8fad diff --git a/unitproc/bkmvln b/unitproc/bkmvln index 0e1cec5..87d3906 100755 --- a/unitproc/bkmvln +++ b/unitproc/bkmvln @@ -1,7 +1,13 @@ #!/bin/bash -# -# inspired by https://stackoverflow.com/questions/8523159/how-do-i-move-a-relative-symbolic-link#8523293 -# by Christopher Neylan +# Desc: Moves sybolic link +# Usage: bkmvln +# Input: arg1: path of existing symbolic link +# arg2: path where link should be moved +# Output: None +# Depends: gnucoreutils 8.30 +# Ref/Attrib: +# 1. Christopher Neylan. https://stackoverflow.com/questions/8523159/how-do-i-move-a-relative-symbolic-link#8523293 +# 2. Tomáš Pospíšek. https://stackoverflow.com/a/30508868 help() { echo 'usage: mv_ln src_ln dest_dir' @@ -12,6 +18,8 @@ help() { exit 1 } +# Show help if `--help` flag given, if arg1 isn't a symbolic link, or +# if arg2 isn't a directory. [ "$1" == "--help" ] || [ ! -L "$1" ] || [ ! -d "$2" ] && help set -e # exit on error