Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and Replace Help 1

Status
Not open for further replies.

dodge20

MIS
Jan 15, 2003
1,048
US
Unix Sco 5.0.5

I am using ls > region.out to get a list of the directory into a file. I then take the file into word and do a find and replace. I replace ^p with |||^pZONENAME|

Is this possible to do using sed? I am new at this.

ZONENAME is a variable that the user inputs.

Dodge20
 
Hi

Do you mean [highlight silver]Hello World[/highlight] [gray]-->[/gray] [highlight silver]ZONENAME|Hello World|||[/highlight] ?
Code:
sed 's/.*/ZONENAME|&|||/' /input/file

Feherke.
 
That looks like what I need. How would I specify ZONENAME as a variable? I tried $ZONENAME but that didn't work.

This is what the code is for grabbing the zonename

echo "Enter the ZONENAME you just created: \c"
read ZONENAME
if [ "$ZONENAME" = "" ]
then
continue
fi


Dodge20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top