From 902511b64b7108eafe372233509baec9c9fa81c9 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Tue, 5 Jan 2010 16:50:28 +0100 Subject: [PATCH] Early version of mv_here.sh This script moves the contents of a given directory into its parent directory, then removes this directory. This is the version I created to integrate in ROX-Filer. --- mv_here/mv_here.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 mv_here/mv_here.sh diff --git a/mv_here/mv_here.sh b/mv_here/mv_here.sh new file mode 100755 index 0000000..7d11caa --- /dev/null +++ b/mv_here/mv_here.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ $# -ne 1 ] ; then + exit 1 +fi + +rep=$(dirname "$1") +cible=$(basename "$1") + +cd "$rep" +mv "$cible"/* . +rmdir "$cible"