[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



On 10/08/2012, at 12.21, Egon Andersen wrote:
> Hej SSLUG'er

[kliiiip]


> 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.

Jeg ville prøve med nogle flere \\\\\\ foran de eksisterende \ og muligvis også foran ( fordi \( og \) har en speciel betydning i sed.


Alternativer kunne måske være at bruge tr til at slette ALLE \, ( og ) tegn i teksten, problemet er at den ikke sletter det som står imellem, men hvis det er den samme tekst alle steder som ikke er i resten af filen så kan du bagefter bruge sed til at fjerne det.



JonB



 
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] *