The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SCO 7.1.1 passwd drewmich SCO 0 04-29-2008 10:58 PM
wc /etc/passwd zhshqzyc Shell Programming and Scripting 1 09-28-2007 04:45 PM
AIX 5.1 to AIX 5.2 /etc/passwd gefa AIX 1 03-31-2005 02:56 AM
no /etc/passwd cyno UNIX for Advanced & Expert Users 3 11-03-2003 04:19 PM
etc/passwd nguda UNIX for Dummies Questions & Answers 2 07-03-2003 10:38 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-05-2009
supercops supercops is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 25
/etc/passwd

Hello All

I want to print only the full name from the /etc/passwd file and print it to the screen .

Could you please let me know how can I do that?
  #2 (permalink)  
Old 06-05-2009
avronius avronius is offline VIP Member  
VIP Member
  
 

Join Date: Apr 2008
Location: Calgary
Posts: 305

Code:
awk -F: '{print $5}' /etc/passwd

  #3 (permalink)  
Old 06-05-2009
bluescreen bluescreen is offline
Registered User
  
 

Join Date: Jun 2008
Location: 0x486F6D65
Posts: 39
or

Code:
cat /etc/passwd | cut -f5 -d":"

HTH
  #4 (permalink)  
Old 06-05-2009
supercops supercops is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 25
Thanks avronius and bluescreen for such a quick responce ....
Will it be possible to send that generated report to an email ?

Like I am doing like this currently but the email is not going throug

cat /etc/passwd | cut -f5 -d":" > abcd && mail mailaddresshere < abcd

Last edited by supercops; 06-05-2009 at 06:21 PM..
  #5 (permalink)  
Old 06-06-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514

Code:
cut -d ":" -f5 /etc/passwd | mailx -s "Report" abc.jam@foo.com


-Devaraj Takhellambam
Closed Thread

Bookmarks

Tags
password

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0