#!/bin/awk -F #File's name: match.awk #Author: Jen Chen #Updated on: #Copyrighted by Jen Chen #Comments: This awk script is used with the shell command "who" #so that the first field contains the user's login name. BEGIN{ } { if($1 ~/jchen13/) printf ("%15s\t%15s\t%35s\n", $1,$4,$6) # On the command line we can use the similar awk command as below # to produce the same result: # awk '{if($1 ~/jchen13/) printf("%15s\t%15s\t%35s\n", $1,$4,$6)}' loo }