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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script question on variables figaro UNIX for Dummies Questions & Answers 2 04-04-2009 06:09 AM
Awk/shell question: Read from file and assign to variables. akbar Shell Programming and Scripting 3 05-07-2008 07:10 PM
Question about variables wswaner UNIX for Dummies Questions & Answers 0 01-17-2007 11:52 PM
A question on C programming and Outputing variables HelpMeIAmLost High Level Programming 2 12-05-2003 03:08 PM
Question variables Korn frank Shell Programming and Scripting 1 11-05-2001 12:01 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-09-2009
fwellers fwellers is offline
Registered User
  
 

Join Date: Mar 2008
Location: Northern, VA
Posts: 23
question about variables with sed

Hi,
I am trying to do some mass replacements in lots of scripts, and using sed.
However sed doesn't seem to like to be able to dereference variables within the substitute clause. For example:

tab=newtable
cat f1 | sed 's/oldtable/$tab/g' doesn't work.
it would replace oldtable with the literal ( $tab ).

I've tried quoting out the $, using eval etc.. but nothing seems to work.

Any ideas are appreciated.

Thanks,
floyd
 

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 08:11 AM.


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