Created
August 12, 2010 10:52
-
-
Save oelmekki/520732 to your computer and use it in GitHub Desktop.
This file contains 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
function cdm(){ | |
target="$1" | |
if [[ ! -d $target ]]; then | |
mkdir -p $target; | |
fi | |
cd $target | |
unset target | |
} | |
function mvm(){ | |
src="$1" | |
dest="$2" | |
if [[ $dest =~ /$ ]]; then | |
target=$dest | |
else | |
target="$(dirname $2)" | |
fi | |
if [[ ! -d $target ]]; then | |
mkdir -p $target | |
fi | |
mv $src $dest | |
unset src dest target | |
} | |
function cpm(){ | |
src="$1" | |
dest="$2" | |
if [[ $dest =~ /$ ]]; then | |
target=$dest | |
else | |
target="$(dirname $2)" | |
fi | |
if [[ ! -d $target ]]; then | |
mkdir -p $target | |
fi | |
cp $src $dest | |
unset src dest target | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment