diff options
Diffstat (limited to 'ves-show.sh')
| -rw-r--r-- | ves-show.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ves-show.sh b/ves-show.sh new file mode 100644 index 0000000..b50487a --- /dev/null +++ b/ves-show.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Print the variables stored in an sh-ves environment, one VAR=value per +# line. With no argument, shows the currently active environment. +# +ves_show() { + env="" + if [ "$#" -ge 1 ]; then + env="$1" + fi + + if ! env=$(_shves_resolve_env "$env"); then + return 1 + fi + + while IFS= read -r line; do + case $line in + export_var:*) + printf "%s\n" "${line#export_var:}" + ;; + esac + done < "$SHVES_ENV_DIR/$env" + + return 0 +} |