The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 04-30-2007
ghostdog74 ghostdog74 is offline
Registered User
 

Join Date: Sep 2006
Posts: 1,434
Quote:
Originally Posted by reborg
Actually you should not use this code, a partial match will result in locking the wrong user.

eg users: user2 and user23 projectuser234 , using user2 will lock all three.

Code:
awk  'BEGIN{IFS = OFS = ":"} $1 == "youruser" { $2 = "*LK*" } { print }' /etc/passwd
ah yes.. i missed out that one, should be == instead. tks
Reply With Quote