Created
May 16, 2026 14:58
-
-
Save konsolebox/9ef66990af880a185ea5491e5f8906b7 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| # Selects Ruby interpreter based on the name of the called symbolic link linked to it. | |
| # This script was composed with significant help from Google AI. | |
| cmd=${0##*/} | |
| if [[ ${cmd} =~ ^([a-zA-Z_-]+)([0-9][0-9])$ ]]; then | |
| base_cmd="${BASH_REMATCH[1]}" | |
| ruby_ver="${BASH_REMATCH[2]}" | |
| exec "/usr/bin/ruby${ruby_ver}" "/usr/bin/${base_cmd}" "$@" | |
| else | |
| echo "Error: '${cmd}' is not a valid versioned symlink target." >&2 | |
| echo "Usage: Create a symlink named <utility><version> (e.g., irb33) pointing to this script." >&2 | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment