Created
September 26, 2019 16:33
-
-
Save talon/602f030f9e6c24c16ce24c5f652179eb to your computer and use it in GitHub Desktop.
learning bash map
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
this_to_that() { | |
case "$1" in | |
# [learn] | |
*) | |
read -rp "$1: " value | |
local add="$1) echo \"$value\";;" | |
sed -i "/\[learn\]/i \ \ \ \ $add" "${BASH_SOURCE[0]}" | |
echo "$value" | |
;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment