Bonjour,
J'ai un fichier de la forme suivante :
Je souhaite récupérer les libélles entre crochet.[HKEY_LOCAL_MACHINE\system\CurrentcontrolSet\Services\GAteway\Parameters]
"RebootOnException"=dword:00000000
[HKEY_LOCAL_MACHINE\system\CurrentcontrolSet\Services\GAteway\Parameters\Codecs]
"DisableEchoCanceller"=hex(7):00
"CodecPreference"=hex
Jusqu'ici, je n'arrive qu'à récupérer les lignes entre crochets comme suit :
J'obtiens alors une variable ^b contenant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 b=` awk ' /HKEY_LOCAL_MACHINE/ {print $0}' $2/$i `
Mais, je ne sais pas quo faire, comment retiré les crochets ?[HKEY_LOCAL_MACHINE\system\CurrentcontrolSet\Services\GAteway\Parameters]
[HKEY_LOCAL_MACHINE\system\CurrentcontrolSet\Services\GAteway\Parameters\Codecs]
Ni comment récupérer les premier seulement ?
Partager