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
Replacing lines in text files Jonny2Vests Shell Programming and Scripting 7 01-28-2008 08:29 PM
help required for replacing text in vi Chandu2u Shell Programming and Scripting 6 01-26-2008 11:12 AM
replacing a nul field with text DarkHound Shell Programming and Scripting 3 09-04-2007 02:34 PM
replacing text ajaya Shell Programming and Scripting 2 04-12-2006 12:31 PM
replacing text in an ascii doc cubs0729 Shell Programming and Scripting 6 09-29-2005 03:05 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 07-24-2006
chrchcol chrchcol is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 36
Replacing text

I was using the following code to replace the path names and it works when it is
Code:
echo "$PWD/$f" | sed -e 's/^.*chris\.domain\.com/chris.domain.com/'
IN fact it works great

However I tried to incorporate a variable

echo "$PWD/$f" | sed -e 's/^.*$account\.domain\.com/$account.domain.com/'

And now the output is not working.

Can anyone help.

Chris
  #2 (permalink)  
Old 07-24-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by chrchcol
echo "$PWD/$f" | sed -e 's/^.*$account\.domain\.com/$account.domain.com/'
Drop the single quotes and introduce " ".

Code:
echo "$PWD/$f" | sed -e "s/^.*$account.domain.com/$account.domain.com/"
You do not have to specifically escape the dot (.)
  #3 (permalink)  
Old 07-24-2006
chrchcol chrchcol is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 36
Thank you so much that worked well.
  #4 (permalink)  
Old 07-25-2006
chrchcol chrchcol is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 36
Problems with find command and time variable

I am using the following
Code:
echo How many hours? 
echo hours
let t=$hours*60

find . -type f -mmin "$t" > holder
Its supposed to find all the files changed in t minutes and put them into the file holder. It does not seem to be working though.

Chris
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 04:43 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