I have a long-ish script to do some data analysis, and it has to connect to several databases. One of the databases tends to update my password more frequently than I like,
You might find the ginput function of gWidgets wraps up what Greg Snow suggests for you:
ginput
gWidgets
require(gWidgets) options(guiToolkit="tcltk") NameVal <- ginput("Enter your passsword:")
NameVal will contain the entered string or NA if you cancel.
NameVal
NA