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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sort / cut question BearCheese Shell Programming and Scripting 5 07-13-2007 03:40 PM
SORT question ssgatbliss UNIX for Dummies Questions & Answers 2 03-22-2007 10:15 AM
Sort/Grep Question aarondesk UNIX for Dummies Questions & Answers 5 03-06-2006 02:57 PM
Sort Question bobo UNIX for Dummies Questions & Answers 7 02-24-2006 09:04 AM
Using Sort kemobyte Shell Programming and Scripting 1 11-30-2005 05:25 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-07-2008
Registered User
 

Join Date: Apr 2008
Posts: 5
how to use sed to sort out this question

root:x:0:0:0000-Admin(0000):/:/sbin/sh
rootcsh:x:0:1:0000-Admin(0000):/:/bin/csh
nocol:x:6312:630:NOCOL Monitor,,,:/usr/local/lib/nocol-client:/usr/local/bin/bash
nobody:x:60001:60001:uid no body:/:/usr/local/bin/bash
noaccess:x:60002:60002:uid no access:/:/usr/local/bin/bash
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:/usr/local/bin/bash
+@c_staff::::::
+::::::/usr/local/sbin/nologin

all above content are in a file called passwd.txt
username:password:uid:gid:gcos-field:home-dir:login-shell
(i)write a shell script and make above output the fields:username,shell,home directory
(ii)and also removes all the lines which start with a '+'

Last edited by sonicstage; 04-07-2008 at 12:43 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 04-07-2008
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 790
is this homework?

what have you done so far?
Reply With Quote
  #3  
Old 04-07-2008
Registered User
 

Join Date: Apr 2008
Posts: 5
i only did very little

sed -e '/^+/d' passwd.txt
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
sed

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0