title: `sed` pattern matching?
body: <pre><code>Permissions   links  Owner  Group  Size   Date        Time    Directory or file
  -rwxr--r--     1     User1  root    26    2012-04-12  19:51    MyFile.txt
  drwxrwxr-x     3     User2  csstf  4096   2012-03-15  00:12     MyDir 
  </code></pre>
  
  <p>I have problem for pattern match to get certain details using the above details. I actually need to write down the shell script to get the following details. <br>
  I need to use pipe in this question. When I do <code>ls -la | prog.sh</code> it need to show the details below. <br> 
  The major part I don't get is how to use <code>sed</code> pattern matching. <br>
  1. Total number of lines read. <br>
  2. Total number of different users (owners). <br>
  3. Total number of files with execute permission for the owner. <br>
  4. The top 3 largest directory. <br>
  This is what I have tried so far <br></p>
  
  <pre><code>#!/bin/bash
  while read j
  
      do 
  
          B=`sed -n '$=' $1`
          echo "total number of lines read = $B"
  
  
  
  done
  </code></pre>