I don't think it's that bad if, for example, it's a wrapper script for a command that uses a password anyway. The values aren't available outside of the script's process,and when it terminates they will be lost. More worrisome is storing them in a plain text file, as has already been mentioned.
If I may give a bit of general advice for our new scripter, however...
1)
Clean, consistent formatting makes code readable and more easily debuggable. Indent all your sub-commands, and separate logical sections with whitespace. Add comments anywhere the code isn't completely obvious (and remember, what seems obvious to you now will not be so a year or so down the line).
Many people also feel that it's more readable to place the "
do/then" keywords on the same line as the "
for/while/until/if" keywords, as it more clearly separates the outside block from the inside block.
Code:
for var in fee fai foo fum ; do
if [[ "$var" == "foo" ]]; then
echo "Found 'foo'."
fi
done
2)
When using
bash or
ksh, it's recommended to use
((..)) for numerical tests, and
[[..]] for string/file tests and complex expressions. Avoid using the old
[..] test unless you specifically need POSIX-style portability.
http://mywiki.wooledge.org/ArithmeticExpression
http://mywiki.wooledge.org/BashFAQ/031
http://wiki.bash-hackers.org/commands/classictest
http://wiki.bash-hackers.org/syntax/...nal_expression
Otherwise, it's looking pretty good.