Skip to content

Instantly share code, notes, and snippets.

@bl0ckeduser
Created November 11, 2012 22:16
Show Gist options
  • Save bl0ckeduser/4056462 to your computer and use it in GitHub Desktop.
Save bl0ckeduser/4056462 to your computer and use it in GitHub Desktop.
Open .exe files intelligently
# Open .exe files in mono or wine depending
# on what the file(1) command says. Useful
# for practical double-clicking from a
# file manager.
if [ ! $1 ]
then
echo "Use: $0 file"
exit 1
fi
if [ ! -e $1 ]
then
echo "no such file $1"
exit 1
fi
if (file -b $1 | grep -i mono)
then
mono $1 &
else
wine $1 &
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment