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

Tags
shell scripts

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
Need help to manipulate data using script nith_anandan Shell Programming and Scripting 8 11-28-2013 10:55 PM
Shell script to manipulate files vedanta UNIX for Advanced & Expert Users 0 04-17-2013 04:19 PM
Manipulate file Tornado Shell Programming and Scripting 5 11-08-2012 10:30 PM
nawk script to manipulate txt file ment0smintz Shell Programming and Scripting 15 10-03-2012 02:56 AM
Manipulate string in shell script Dev_Sharma987 Shell Programming and Scripting 3 04-17-2011 03:19 AM
Script to manipulate contents of clipboard js8765 Shell Programming and Scripting 3 12-05-2010 11:44 AM
Shell script to manipulate a file deo_kaustubh Shell Programming and Scripting 2 08-09-2010 08:41 PM
call a passwd file to a script multiple times raghu.iv85 Shell Programming and Scripting 1 06-18-2010 02:53 PM
Script to manipulate logfile text rosspaddock Shell Programming and Scripting 11 12-02-2008 09:10 PM
script to update gecos in passwd file jyoung Shell Programming and Scripting 1 03-05-2008 01:45 PM


All times are GMT -4. The time now is 08:48 AM.

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