The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: awk - print
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-12-2008
c00kie88 c00kie88 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 63
awk - print

Hi all,

I have script below:

#!/bin/sh

$name=blah

awk -F: -v user="$name" '$1 == user{print $1 ":" $2 ":" $3 ":" $4}' /etc/shadow > /tmp/shadow.tmp

based on above, it will only print one line which is "blah" username details.

What do i need to do to print all contents of shadow file including "modified" blah user?