👤
Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

sed script to manipulate the /etc/passwd file

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 11-29-2009
Java sed script to manipulate the /etc/passwd file

Hi. Can anybody help me with a script to extract usernames, shell and home_directory from the /etc/passwd file.

I am stuck
# 2  
Old 11-29-2009
To extract the fields in that order:

Code:
cat /etc/passwd|awk -F: '{print $1,$7,$6}'

# 3  
Old 11-29-2009
You can eliminate the UUOC (for the unfamiliar - Useless Use of Cat)
Code:
awk -F: '{print $1,$7,$6}' /etc/passwd

👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
nawk script to manipulate txt file ment0smintz Shell Programming and Scripting 15 10-03-2012 02:56 AM
Manipulate columns using sed stoyanova Shell Programming and Scripting 1 06-11-2011 09:02 PM
Shell script to manipulate a file deo_kaustubh Shell Programming and Scripting 2 08-09-2010 08:41 PM
Manipulating the etc/passwd file with sed Pauline mugisha Shell Programming and Scripting 11 12-01-2009 02:29 AM
Manipulate lines with sed/awk TheBigAmbulance Shell Programming and Scripting 2 06-29-2009 04:29 PM
manipulate postscript via sed lada niva Shell Programming and Scripting 3 02-03-2009 11:36 AM
RE or Sed to manipulate a document phpfreak Shell Programming and Scripting 6 12-04-2008 02:09 AM
Sed command to find, manipulate and replace a number LT_2008 Shell Programming and Scripting 6 11-13-2008 10:28 AM
using sed to manipulate text in files Jefferson333 UNIX for Dummies Questions & Answers 3 08-09-2008 03:26 AM
sed or other tool to manipulate data, including email addresses manouche Shell Programming and Scripting 3 02-19-2008 04:53 PM


All times are GMT -4. The time now is 09:21 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?