[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Sed
From: |
Eliphas Levy Theodoro |
Subject: |
Re: [shell-script] Sed |
Date: |
Sun, 19 May 2002 16:39:08 -0300 (BRT) |
cec_silva, @ 17/05/02 - 13:39:
> Preciso fazer um script que formate um arquivo
> texto com o sed. Já consegui outras partes mas parei,
> por que nao consegui o seguinte:
>
> Trocar todas as aspas duplas " de uma linha por aspas
> simples '.
>
> E incluir aspas duplas " no final de cada linha.
sed 's/"/\'/g;s/$/"/' texto
Pra trocar as aspas : s/"/'/g
Pra incluir as aspas: s/$/"/
Veja que eu tenho que escapar a aspa simples na expressão porque estou
usando-a para definir o "parâmetro". Requerimento do shell.
--
Eliphas
Anyone sending unsolicited bulk email (UBE, SPAM) to this address will
be charged a $25 handling fee plus a $5 network traffic fee per
started kilobyte. By extracting my address from this message or its
header, you agree to these terms.
Nevertheless, spammers trying to auto-extract addresses from this
message will definitely want to include address@hidden, address@hidden,
and address@hidden
- Sed, cec_silva, 2002/05/19
- Re: [shell-script] Sed,
Eliphas Levy Theodoro <=