This file contains 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
function select_path { | |
# BASH function to make the user select a directory in $PATH. | |
# Outputs the path on success, returns 1 on error, and 2 when | |
# no path is selected. | |
# Arguments: | |
# $1 : Prompt for the select menu. | |
# Default: "Choose the installation path:" | |
# Example usage: | |
# if mypath="$(select_path)"; then | |
# echo "Success: $mypath" |