M.Qasim
M.Qasim

Reputation: 1878

Get password from R console

I wonder if it is possible to get password from R command line. I have tried several variants of the following, but characters are echoed on the screen when entered.

password = scan(file = "", what = character(), nmax = 1)

Upvotes: 2

Views: 1620

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368409

You need a UI component that knows a password is typed, and hence shows the stars.

The only portable one is part of the tcltk package, and has been recommended a few times in the past.

Edit: The getPass package provides a wrapper to several underlying approaches.

Upvotes: 4

Related Questions