The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-11-2002
Perderabo's Avatar
Perderabo Perderabo is offline
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,717
Re: Regular expressions in sed

Quote:
Originally posted by mfreemantle

The problem is that using sed with filenames that contain the / character causes matches to fail.

eg:
fileName=/mnt/someinputfile
sed -e "s/param1/${fileName}/g" somefile.txt > runfile


Ideas??
Try:
sed -e "s=param1=${fileName}=g" somefile.txt > runfile

Sed's s command does not require the use of a slash as a delimiter. You can use any character. Pick a character that is not in your data.