title: What does "read -p" do in a linux shell script?
body: <p>I have a script that I have copied and edited. There are a couple of lines in there that I need explaining if possible please.</p>
  
  <p>These are the lines:</p>
  
  <pre><code>     read -p "please enter the username you wish to create: " username
       if id -u $username &gt;/dev/null 2&gt;&amp;1; then
  </code></pre>
  
  <p>What does <code>read -p</code> do? What does <code>id -u</code> do? What does <code>&gt;/dev/null 2&amp;1;</code> do?
  Then further on in the script, it has this line that says this:</p>
  
  <pre><code>     sudo useradd -g $group -s $bash -d $homedir -m $username -p $password
  </code></pre>
  
  <p>Again please could someone explain all the minus signs in this line please? (<code>-g</code>, <code>-s</code>, <code>-d</code>, <code>-m</code>, <code>-p</code>)</p>