Project

General

Profile

1
#!/bin/sh
2
# Sets a password environment variable
3

    
4
if test "$#" -lt 1; then
5
    echo "Usage: . $0 env_var_name (note the \".\" at the beginning)"
6
    exit 2
7
fi
8

    
9
if test -z "${!1+t}"; then # env var with name $1 is unset
10
    read -s -p "Enter $1: "; echo
11
    export "$1"="$REPLY"
12
fi
(3-3/12)