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
& in SQL query Lindarella Shell Programming and Scripting 3 10-09-2006 04:43 PM
Query in awk raguramtgr UNIX for Dummies Questions & Answers 1 08-31-2004 05:38 AM
Query In awk raguramtgr UNIX for Dummies Questions & Answers 1 08-27-2004 11:00 AM
RPM Query silvaman UNIX for Advanced & Expert Users 1 08-15-2003 07:56 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 05-14-2007
gopsman gopsman is offline
Registered User
  
 

Join Date: May 2007
Posts: 25
sed query

hi
i had posted this earlier.. got no reply !!
how to change assigned value in a file using sed
suppose the file contains
age = 30;

how to change it to
age =50;

i tried sed 's/^age*./age =50;' filename but i am getting the o/p as

age =50; 30;

plz hlp!!
  #2 (permalink)  
Old 05-14-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,715
's/^age = 30/age =50;/'

You must have gotten an error form sed because the command was missing the ending /
  #3 (permalink)  
Old 05-14-2007
kahuna's Avatar
kahuna kahuna is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 149
Quote:
Originally Posted by gopsman
i tried sed 's/^age*./age =50;' filename but i am getting the o/p as
I think asterisk and period are reversed. Try
Code:
sed 's/^age.*/age =50;/' filename
  #4 (permalink)  
Old 05-14-2007
gopsman gopsman is offline
Registered User
  
 

Join Date: May 2007
Posts: 25
Quote:
Originally Posted by kahuna
I think asterisk and period are reversed. Try
Code:
sed 's/^age.*/age =50;/' filename

hi thnks tht worked!!
  #5 (permalink)  
Old 02-03-2009
tanyaheerani tanyaheerani is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 3
How to post a query in this forum.
please help

Last edited by tanyaheerani; 02-04-2009 at 11:19 AM..
Sponsored Links
Closed Thread

Bookmarks

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 06:27 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