Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
542 B

#!/bin/sh
show_help () {
cat<<DOC
yank: stashes a file or directory for put or put-mv
USAGE:
yank path_to_yank
EXAMPLE:
yank random.txt
cd ~/notes
put-mv
DOC
}
main () {
if [ $# -eq 0 ]; then
echo "No path given to yank."
echo
show_help
exit 65
fi
# Here we get the real path, chop the newline off the end, and stash.
yanked_path=`realpath "$1"`
yanked_path=${yanked_path%\\n}
echo "$yanked_path" > ~/.yanked_file && echo "yanked '$yanked_path'; put to cp, put-mv to mv"
}
main "$@"