LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2004, 12:03 AM   #1
captgoodnight
Member
 
Registered: Jan 2002
Distribution: suse 7.2
Posts: 56

Rep: Reputation: 15
easy sed question, i hope


Here's what I'm trying to do,

SITEA="http:\/\/www.linuxsecurity.com<\/stringvalue"
SITEB="http:\/\/www.google.com/linux<\/stringvalue"

sed 's/$SITEA/$SITEB/' file

No go, how? I've tried all sorts of things, I give up. Please, I know it has to be something simple.

newbie here,
cg
 
Old 02-27-2004, 02:14 AM   #2
cjcuk
Member
 
Registered: Dec 2003
Distribution: Openwall, ~LFS
Posts: 128

Rep: Reputation: 15
I am guessing, but I do not think it is a sed problem. You are using single quotes, and thus the shell does not expand the variables ( as it does not bother interpreting single-quoted text ). Try the same sed phrase inside double quotes.
 
Old 03-11-2004, 03:03 PM   #3
free_ouyo
Member
 
Registered: Mar 2004
Location: Belgium
Distribution: Ubuntu
Posts: 133

Rep: Reputation: 15
Hy,

SITEA="http:\/\/www.linuxsecurity.com<\/stringvalue"
SITEB="http:\/\/www.google.com/linux<\/stringvalue"

sed 's/$SITEA/$SITEB/' file - search $SITEA and replace by $SITEB not the content of the variables.

Why not try to do

SITEA=$SITEB

Hope this help.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Question (I hope) jon3k Linux - General 3 04-13-2005 02:51 PM
(Yes, another winmodem problem), But this one is Easy (I hope) carrie SUSE / openSUSE 8 02-08-2005 06:12 PM
VMware (well thought-out question, i hope) RevLinux Linux - Software 4 12-31-2004 07:31 AM
I hope this is not such a stupid question! angmaya Linux - Newbie 3 10-17-2003 11:59 PM
Two easy questions i hope matrim Linux - Newbie 4 12-21-2002 10:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration