The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
sort / cut question BearCheese Shell Programming and Scripting 5 07-13-2007 06:40 PM
SORT question ssgatbliss UNIX for Dummies Questions & Answers 2 03-22-2007 01:15 PM
Sort/Grep Question aarondesk UNIX for Dummies Questions & Answers 5 03-06-2006 05:57 PM
Sort Question bobo UNIX for Dummies Questions & Answers 7 02-24-2006 12:04 PM
Using Sort kemobyte Shell Programming and Scripting 1 11-30-2005 08:25 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-07-2008
sonicstage sonicstage is offline
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 03:43 AM..
  #2 (permalink)  
Old 04-07-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

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

what have you done so far?
  #3 (permalink)  
Old 04-07-2008
sonicstage sonicstage is offline
Registered User
  
 

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

sed -e '/^+/d' passwd.txt
Closed Thread

Bookmarks

Tags
sed

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 10:30 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