Project

General

Profile

« Previous | Next » 

Revision 186

env_password: Print Usage message to stderr

View differences:

scripts/util/env_password
1 1
#!/bin/bash
2 2
# Sets a password environment variable
3 3

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

  
9 7
if test -z "${!1+t}"; then # env var with name $1 is unset
10 8
    read -s -p "Enter $1: "; echo

Also available in: Unified diff