UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2005, 12:21 PM
guest guest is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 163 guest Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 10 h 1 m 44 sec
Reputation Power: 0
File manipulation

I Have a file which has the structure as

filesystemname %usage %left Flag
/tmp 87 13 1
/tmp/kir 24 76 0
/tmp/kra 50 50 1
/tmp/kir/vin 23 77 2

I need to manipulate only the flag value. i.e., I should be able to change only the flag value. If i do need to change the flag under /tmp/kra how can I do that with out changing the other variables.

Reply With Quote
  #2  
Old February 1st, 2005, 01:12 PM
vgersh99 vgersh99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 47 vgersh99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 5 h 41 m 53 sec
Reputation Power: 4
Send a message via AIM to vgersh99 Send a message via MSN to vgersh99 Send a message via Yahoo to vgersh99
# changes '1' to '1000'
sed -e '/\/tmp\/kra /s/[^ ][^ ]*$/1000/g' file.txt

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > File manipulation


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway