Skip to content

Instantly share code, notes, and snippets.

@chanux
Created March 20, 2015 09: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 chanux/5c7da348e7aeda9f471d to your computer and use it in GitHub Desktop.
Save chanux/5c7da348e7aeda9f471d to your computer and use it in GitHub Desktop.
# Fish port of Marcin Kulik's newscratch script
# Read more and fin \d bash/zsh scripts here:
# http://www.ku1ik.com/2012/05/04/scratch-dir.html
function new-scratch
set cur_dir "$HOME/scratch"
set dir_suffix (date +'%s')
set new_dir "$HOME/tmp/scratch-$dir_suffix"
mkdir -p $new_dir
ln -nfs $new_dir $cur_dir
cd $cur_dir
echo "New scratch dir ready for grinding ;>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment