2017-06-21 20:02:03 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-07-02 22:06:24 +02:00
|
|
|
# Moves a file to another place and put a symbolic link in place
|
|
|
|
|
2018-04-10 15:38:18 +02:00
|
|
|
function rep_help {
|
2017-07-02 22:06:24 +02:00
|
|
|
echo "Usage: $0 SOURCE DEST"
|
|
|
|
echo
|
|
|
|
echo "Arguments:"
|
|
|
|
echo " SOURCE File to be moved"
|
|
|
|
echo " DEST Where to be moved"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2017-06-21 20:02:03 +02:00
|
|
|
mv "$1" "$2"
|
|
|
|
ln -s "$2" "$1"
|
2017-07-02 22:06:24 +02:00
|
|
|
|
|
|
|
# MAIN
|
|
|
|
command="$1"
|
|
|
|
shift
|
2018-04-10 15:38:18 +02:00
|
|
|
if type "rep_$command" &> /dev/null; then
|
|
|
|
"rep_$command" "$@"
|
2017-07-02 22:06:24 +02:00
|
|
|
else
|
2018-04-10 15:38:18 +02:00
|
|
|
rep_help
|
2017-07-02 22:06:24 +02:00
|
|
|
fi
|
|
|
|
|