[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SCRIPT LEYENDO LINEAS RECURSIVAMENTE



El día 3 de noviembre de 2010 10:45, Jorge A. Secreto
<jorgesecreto@gmail.com> escribió:
> El día 3 de noviembre de 2010 08:06, Camaleón <noelamac@gmail.com> escribió:
>> El Tue, 02 Nov 2010 14:55:49 -0600, rantis cares escribió:
>>
>> (...)
>>
>>> TODOS=$(cat /home/PEDRO/informacion.txt)
>>>
>>> rm $TODOS
>>>
>>> Realmente no pido una respuesta, solo que me guien porque al no saber
>>> tanto los terminos, no puedo buscar en internet.
>>
>> Hazlo con "sed", como te dice Javier. No necesitas estructuras de bucle.
>>
>> Básicamente:
>>
>> ***
>> sed -i 's/original/reemplazo/g' /ruta/a/archivo.txt
>> ***
>>
>
> Acá me perdí...
> Lo que quería hacer él ¿no era borrar los archivos que figuraban en una lista?
> No uso sed pero, por el man, me parece que no es lo que hace.
> ¿Me explicas que hace ese comando?
> Gracias
>

del man
*****
       s/regexp/replacement/
              Attempt to match regexp against the pattern space.  If
successful, replace that portion matched with replacement.  The
replacement may contain  the  spe‐
              cial  character & to refer to that portion of the
pattern space which matched, and the special escapes \1 through \9 to
refer to the corresponding match‐
              ing sub-expressions in the regexp.
*****

si entiendo bien esa orden reemplaza texto detro del archivo (y la g
final ¿agrega un espacio?)
Disculpá la disgresión pero estoy perplejo :-S



-- 
Jorge A Secreto
Analista de Sistemas
MP 361


Reply to: