SED script

Hi ,

i am stuck in this simple script.

#!/bin/ksh
echo "enter the file name"
read flname
echo "enter version"
read ver
grep $flname /home/con/snsc/perl/map > flplist
dirname `cat flplist` |  sed 's/\/so${vers}\//\/so${vers}_xyz\//' > dirlist

the map file is basically a list of file with full path.
my grep will result a flplist
which looks like this

/home/con/snsc/perl/templates/so211/ajax/123.txt

my results should look like

/home/con/snsc/perl/templates/so211_xyz/ajax/

but this script will give a out put similar to the path in flplist
please help in this.
if you need more details please tell me.

You are reading ver and doing ${vers}, $vers in nothing,while $ver is.
Replace the ' around sed expression to " for your ${ver} to work.

Regards
Peasant.

thanks.

the first line you wrote is just my typo here.
the second line is just what i want..

:wall: i m just a noob

Change your sed line to :

sed "s#\(so${ver}\)#&_xyz#g"

Hope that helps,
Regards
Peasant.