0

I want to use adduser USER (USER is a user name), but this asks me many questions like full name and address. I want a script which types the return key automatically and skip those questions. For example, I execute ./myadduser.sh USER and myadduser.sh call adduser USER and input return to all questions. Is there a great way to do this? I am thinking about Ubuntu 14.04.

Sorry, I made a mistake. Input return not to all questions since I have to input password which cannot be return. Is it possible to input return to all questions except questions about password?

Nickel
  • 103
  • 3

1 Answers1

0

The yes command continuously outputs the first argument provided followed by a newline until stopped. So this should work for you: yes "" | adduser ....

However, most modern programs have similar things built in already, or make it so that you can pass all needed information on the command line, to make it script-friendly. I believe this is the case with adduser on Ubuntu.