Skip to content

Instantly share code, notes, and snippets.

@fczuardi
Created August 12, 2011 20:53
Show Gist options
  • Select an option

  • Save fczuardi/1142975 to your computer and use it in GitHub Desktop.

Select an option

Save fczuardi/1142975 to your computer and use it in GitHub Desktop.
Trouble remembering ln -s source/target order?
#!/bin/bash
ln -s $1 $2
if [ $? -ne 0 ]; then
read -p "Try the inverse?" yn
case $yn in
[Yy]* ) `ln -s $2 $1`;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment