I am currently writing a bash script and when i run the useradd command it requires 2x input. What is the command to input from the bash script into the prompted password fields from useradd?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the input is being read from stdin, you could do this;
Some programs, however, do not read from stdin precisely to stop this kind of thing.
Edit
As remarked upon, this is called a “HERE document”, in case you want to look it up.