litle help with sed or awk

litle help with sed or awk

Post by Andrea » Thu, 20 Nov 2003 01:53:26



... Linux beginner!
Hallo,
could somebody help me to do this
Problem:
I need my Windows Registry to patch for setting back my Program Folder to
C:\ (it is on D: in W98PRG
that means

i did my Progam Folder to D:\W98PRG
and want now to change to C:\Programme
but i saw in the exported registry that the naming was PROGRA~1 (8.3) in
some Cases.

for example:
___________________________________________________________________________
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\VarLDID]
"28700"="D:\\W98PRG"
"28701"="D:\\W98Prg"
"28702"="D:\\W98PRG"
"28710"="D:\\W98PRG\\ZUBEHR"
"28720"="D:\\W98PRG\\ZUBEHR\\HYPERT~1"
M
"28730"="D:\\W98PRG\\GEMEIN~1"
"28732"="D:\\W98PRG\\GEMEIN~1"
"28740"="D:\\W98PRG\\GEMEIN~1\\MICROS~1"
"28742"="D:\\W98PRG\\GEMEIN~1\\MICROS~1"
"29000"="C:\\NT4WORK\\NTPRG\\INTERN~1"
"29001"="C:\\NT4WORK\\NTPRG\\Internet Explorer"
_______________________________________________________
Now I tried to use awk or sed to do

1. search for the ~ in lines
2 if is ~ then replace d:\\W98PRG to C:\\PROGRA~1 in the file myreg.reg.
but i didn't solved it

Regular expressions was not the problems but the logik AND

could somebody help me

thx

Andreas

 
 
 

litle help with sed or awk

Post by Ed Morto » Thu, 20 Nov 2003 04:48:33



<snip>

Quote:> 1. search for the ~ in lines
> 2 if is ~ then replace d:\\W98PRG to C:\\PROGRA~1 in the file myreg.reg.
> but i didn't solved it

> Regular expressions was not the problems but the logik AND

What "AND"? This will do it:

     sed '/~/s/D:\\\\W98PRG/C:\\\\PROGRA~1/' myreg.reg

Regards,

        Ed.

Quote:> could somebody help me

> thx

> Andreas