[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] sed regular expression driller mig



Den 10-08-2012 12:21, Egon Andersen skrev:
Hej SSLUG'er

Jeg har en stak filer, hvor der har indsneget sig en fejl.
Fejlen er simpelthen at der er kommet en tekst med der skulle være
blanktegn. Det der driller mig er blot, at teksten starter med:
\(
og slutter med
\)

Altså en tekst som ligner følgende: \(den fejlagtige tekst\)

Jeg har forsøgt noget i stil med:

sed -c -i_orig {s/\(den fejlagtige tekst\)/                 /} *.txt

Jeg får fejlmeddelelsen:
sed: -e udtryk nr. 1, tegn 7: unterminated `s' command

Jeg har også forsøgt at escape både ' '(mellemrum), \ og (, men jeg
vedbliver at få en fejl enten i stil med ovenstående eller syntax error.

Jeg er overbevist om at det er et eller andet simpelt jeg bare lige har
misset.

Håber der er en der kan hjælpe.

Med venlig hilsen
Egon Andersen


Som udgangspunkt har \( og \) en særlig betydning for sed

derudover vil sed normalt skulle have '' om kommando strengen

jeg kender ikke optionen -c, men jeg ville selv forsøge mig med:

sed -r 's!\(den fejlagtige tekst\)/                 /' *.txt



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2012-09-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *