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

Re: Sed: sostituzioni



... forse cosí?

VARIABILE=$( sed -n '1p' file.txt )


cmq guarda anche qui:
https://blog.squadrainformatica.com/it/blog/sed
http://www.grymoire.com/Unix/Sed.html#uh-8
http://stackoverflow.com/questions/3337936/remove-non-ascii-characters-from-csv
http://www.gentoo.org/doc/it/articles/l-sed2.xml

Il 27/11/13, antispammbox-debian<antispammbox-debian@yahoo.it> ha scritto:
>
> Un ultima cosa.
>
> Mi sai dire se è possibile assegnare ad una variabile la prima riga
> letta da sed?
>
>
> Ciao
>
>>puoi usare tr per sostituire i caratteri singoli
>
>>-------------------------------------------------------
>>$ cat t1
>>10/10/2013 10:10
>># , : , ' , ?, >, <, », *.
>
>>$ cat t1 | tr '#' '!' | tr ':' '.' | tr '<' '"' | tr '*' '!'
>>10/10/2013 10.10
>>! , . , ' , ?, >, ", », !.
>>-------------------------------------------------------
>
>>non ho capito se devi modificare anche la prima linea...
>
>>in tal caso:
>>-------------------------------------------------------------------------------------------
>>$ cat t1 | tr '#' '!' | tr ':' '.' | tr '<' '"' | tr '*' '!' | tr '/'
>>'.' | sed 's|2013|10|'
>
>>10.10.10 10.10
>>! , . , ' , ?, >, ", », !.
>>---------------------------------------------------------------------------------------------
>
>
>


-- 
ciao,
MaX


Reply to: