Skip to content

Instantly share code, notes, and snippets.

@aont
Created March 19, 2014 07:45
Show Gist options
  • Select an option

  • Save aont/9637162 to your computer and use it in GitHub Desktop.

Select an option

Save aont/9637162 to your computer and use it in GitHub Desktop.
binary selector
#!/bin/sh
platform="$(uname -s).$(uname -p)"
if [ -n "$1" ]; then
prog="$1"
shift
if [ -e "$prog.$platform" ]; then
"$prog.$platform" "$@"
else
"$prog" "$@"
fi
else
echo "$platform"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment