Skip to content

Instantly share code, notes, and snippets.

@bmarini
Created October 14, 2011 17:20
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 bmarini/1287720 to your computer and use it in GitHub Desktop.
Save bmarini/1287720 to your computer and use it in GitHub Desktop.
A little time saver for cd'ing into my most common directory (current project I am working on)
onscreen()
{
if [ -z $1 ]; then
if [ -f $HOME/.onscreen ]; then
cd `cat $HOME/.onscreen`
else
echo "You must set an onscreen destination"
echo "cd into a directory and run 'onscreen set'"
fi
fi
if [ "$1" = "set" ]; then
echo `pwd` > $HOME/.onscreen
echo "`pwd` set as onscreen destination."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment