title: What do $? and $# stand for in Shell Script?
body: <p>I have the following two chunks of code, I am not so sure what $? and $# stand for. Please help.</p>
  
  <p><strong>CODE ONE</strong></p>
  
  <pre><code> #!/bin/bashUSERID="$1" 
   /bin/id $USERID 2&gt;/dev/null
  [ $? -eq 0 ] &amp;&amp; echo "User found" || echo "User not found"
  
  /bin/id -g $USERID 2&gt;/dev/null
  [ $? -eq 0 ] &amp;&amp; echo "Group found" || echo "Group not found"    `
  
  
  $ cat &gt; mtable
  </code></pre>
  
  <p><strong>CODE TWO</strong></p>
  
  <pre><code>#!/bin/sh
  #
  #Script to test for loop
  #
  #
  if [ $# -eq 0 ]
  then
  echo "Error - Number missing form command line argument"
  echo "Syntax : $0 number"
  echo "Use to print multiplication table for given number"
  exit 1
  fi
  n=$1
  for i in 1 2 3 4 5 6 7 8 9 10
  do
  echo "$n * $i = `expr $i \* $n`"
  done
  </code></pre>
  
  <p>Thank you</p>