|
eval 'initdb --username="$POSTGRES_USER" --pwfile=<(echo "$POSTGRES_PASSWORD") '"$POSTGRES_INITDB_ARGS"' "$@"' |
If $POSTGRES_PASSWORD matches the regular expression ^-[neE]+$, the password will be set to an empty string because echo will interpret it as options. (Different shells allow different options for echo, scripts using echo with unknown/variable arguments are therefore not portable.)
printf %s "$POSTGRES_PASSWORD" should be used instead.