Skip to content

Instantly share code, notes, and snippets.

@justin-endler
Last active September 5, 2018 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justin-endler/93a68ab9e472d4e6a015ab71d86d0a30 to your computer and use it in GitHub Desktop.
Save justin-endler/93a68ab9e472d4e6a015ab71d86d0a30 to your computer and use it in GitHub Desktop.
mv to destination, same name
#!/bin/bash
# get source and destination parent
if [[ -z $1 ]]; then
echo "source and destionation parent arguments required"
exit 1
fi
SOURCE=$1
DESTINATION_PARENT=~/Documents/bb-bk-00
# derive DESTINATION
DESTINATION="$DESTINATION_PARENT/$SOURCE"
echo $DESTINATION;
# move file
mv $SOURCE $DESTINATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment