title: Log of a shell script
body: <p>I'm working on a shell script.
  How can I save the log: who executed, when, and also the command into a log.txt file.
  So how can I rewrite the command that users use to the log file
  Like</p>
  <pre><code>22/11/2021 - 1:23 - ./submit -l
  22/11/2021 - 2:23 - ./submit file1 file2
  22/11/2021 - 3:23 - ./submit ...
  </code></pre>
  <p>Here is part of my code</p>
  <pre><code>help() {
      echo &quot;$1 syntax is $1 &lt;option&gt;&quot;
      echo &quot;&quot;
      echo &quot;where the option is one of the following&quot;
      echo &quot; -l -- to print all file u already summited&quot;;
      echo &quot;log -- to log&quot;
  }
  
  list() {
      ls -l $submitfolder; 
  }
  
  log() {
      NOW=`date '+%H:%M_%d/%m/%Y'`
      echo &quot;$NOW - $USER - &quot; &gt;&gt; $logfile;
  }
  
  case $1
  in
      l | -l) list $@;;
      log) log $@;;
      help | -help | --help) help $@;;
      *) input $@;;
  esac
  </code></pre>