I fairly new to SED. I have tried many different variations of this line of code and even breaking it down into its components and running them separately.
They work individually without variables but when I place the $todbname variable it will either inserts the text "connect to $todbname" or it will give the command garbled as it has this time.
This is the code that is not working properly
-e '1i\
connect to "$todbname";'
The entire line of code and bourne trace is below.
This results in "connect to $todbname" being inserted on the first line of the file.
sed -e 's/^[ \t]//;s/[ \t]$//' -e '/./,/^$/!d' -e "/$fromdbuser/ s//$todbuser/g" -e '1i\
connect to $todbname;' fk_"$todbname".sql.orig > fk_"$todbname".sql
This results in the command garbeld error.
`sed -e 's/^[ \t]//;s/[ \t]$//' -e '/./,/^$/!d' -e "/$fromdbuser/ s//$todbuser/g" -e '1i\
connect to "$todbname";' fk_"$todbname".sql.orig > fk_"$todbname".sql`
+ sed -e s/^[ \t]//;s/[ \t]$// -e /./,/^$/!d -e /db8inst/ s//db8inst1/g -e 1iconnect to "$todbname"; fk_eldtest.sql.orig
sed: command garbled: 1iconnect to "$todbname";
Can anyone help me?
Thanks,
Eric