Created
November 11, 2012 22:16
-
-
Save bl0ckeduser/4056462 to your computer and use it in GitHub Desktop.
Open .exe files intelligently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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