title: How to write a shell script that upon invocation shows the time and date and lists all the logged-in users.This information is then saved in a file
body: <p>I need to list all the logged in users along with the date and time of log in. How can I do that using shell script?</p>
  
  <pre><code>#!/bin/bash
  cat &gt; log.log &lt;&lt; EOF1
  how to replace the bash command 'w' in here
  EOF1
  
  </code></pre>