aboutsummaryrefslogtreecommitdiff
path: root/mvln
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-20 20:44:34 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-20 20:44:34 -0300
commite851401694daacaf1aba2c87ed557e5dbf00af02 (patch)
treed772b15f3a5ba9e015936f7162f448a7208a4001 /mvln
parentd6a4d78d31ffa57e00a7d5b0a87baa38156cee06 (diff)
downloadscripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.gz
scripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.bz2
Move scripts to other repositories
Diffstat (limited to 'mvln')
-rwxr-xr-xmvln23
1 files changed, 0 insertions, 23 deletions
diff --git a/mvln b/mvln
deleted file mode 100755
index ec4c359..0000000
--- a/mvln
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-#
-# Move a file but keep a symlink behind.
-#
-# See http://www.linuxquestions.org/questions/linux-newbie-8/script-to-move-old-files-create-symbolic-link-728618/
-# http://lifehacker.com/5270634/move-files-without-breaking-stuff
-# https://stackoverflow.com/questions/9251818/bash-move-file-directory-and-create-a-link-of-it
-# http://serverfault.com/questions/8108/move-a-file-and-leave-a-soft-link-behind
-
-# Parameters
-BASE="$(basename "$1")"
-ORIG="$(dirname "$1")"
-DEST="$2"
-
-# Check
-if [ ! -e "$ORIG/$BASE" ]; then
- echo "File not found: $ORIG/$BASE"
- exit 1
-fi
-
-# Proceed
-mkdir -p "$DEST"
-mv "$ORIG/$BASE" "$DEST" && ln -s "$DEST/$BASE" "$ORIG/$BASE"