From: Janis Papanagnou on
On 11/08/10 16:49, trighole wrote:
[...]
>
> I'd prefer to exut this sed in CSH, as it is in a csh script and
> embeded in a loop, it could slow the process to switch from csh to sh
> multiple times
>
> fab

Of course you should not switch forth and back between the two shells.

But, in the first place, you really shouldn't use csh for scripting;
browse the archives for the many reasons why not.

Have you tried to use single quotes and exclude the variable expansion;
as in sed -e '...'$var'...' - don't recall whether that works in csh.

Good luck anyway, whatever you decide.

Janis
From: Michael Tosch on
Janis Papanagnou wrote:
> On 11/08/10 16:49, trighole wrote:
> [...]
>> I'd prefer to exut this sed in CSH, as it is in a csh script and
>> embeded in a loop, it could slow the process to switch from csh to sh
>> multiple times
>>
>> fab
>
> Of course you should not switch forth and back between the two shells.
>
> But, in the first place, you really shouldn't use csh for scripting;
> browse the archives for the many reasons why not.
>
> Have you tried to use single quotes and exclude the variable expansion;
> as in sed -e '...'$var'...' - don't recall whether that works in csh.
>
> Good luck anyway, whatever you decide.
>
> Janis

sed '...'"$var"'...'

is somewhat safer.
Or do \" outside the "string" so it becomes "string1"\""string2":

sed "s#\(^\.INCLUDE[ \t]*"\""\).*\(noMisMatch\)#\1$MODEL_DIR\2#"

--
echo imhcea\.lophc.tcs.hmo |
sed 's3\(....\)\(.\{5\}\)3\2\132;s2\(.\)\(\)\(.\)2\3\12g;1s;\.;::;2'