eitchugo
48p96 comments posted · 2 followers · following 0
8 years ago @ Devin - Scripts Init no Linux ... · 0 replies · +4 points
Depende do tipo de desktop que você usa, cada um tem o seu jeito, mas geralmente basta colocar um arquivo "atalho" de extensão .desktop no ~/.config/autostart
8 years ago @ Devin - Replicação MySQL · 0 replies · +1 points
O 'increment' significa de "quanto em quantos" números ele vai incrementar. Supondo que o primeiro valor seja 1, se usarmos um increment de 2, ficaria:
1, 3, 5, 7, 9, [...]
Se usarmos um increment de 10, ficaria:
1, 11, 21, 31, 42, [...]
Pra especificar de onde começar (no exemplo acima foi o 1), a gente usa o 'offset'.
'increment em 2, com 'offset', 2:
2, 4, 6, 8, 10, [...]
'increment' em 10, com 'offset' 2:
2, 12, 22, 32, 42, [...]
8 years ago @ Devin - Replicação MySQL · 0 replies · +2 points
Eu nunca tentei e nem vi alguém fazendo isso, mas vale a tentativa
9 years ago @ Devin - Comandos de Tratamento... · 1 reply · +1 points
$ grep -A1 -E "^>g(1|4)" input
>g1
AAAAATTT
--
>g4
TTAG
9 years ago @ Devin - LVM no Linux · 0 replies · +1 points
Na minha opinião, é melhor que gastar papel e tinta :P
9 years ago @ Devin - Comandos de Tratamento... · 0 replies · +1 points
string1:substituto1
string2:substituto2
string3:substituto3
(Importante que seja um caracter como dois pontos, e sem espaços, senao tem que tratar melhor)
Pode-se ler cada linha, separar os campos por dois pontos e ir fazendo o sed no outro.txt:
for STRINGS in $(cat arquivo.txt); do
PATTERN=$(echo "$STRINGS" | cut -d ":" -f1)
REPLACE=$(echo "$STRINGS" | cut -d ":" -f2)
sed -i -r "s/$PATTERN/$REPLACE/g" outro.txt
done
9 years ago @ Devin - Comandos de Tratamento... · 1 reply · +1 points
sed -i "s/.*(Musica).*/\1/" arquivo
O que singifica: Se a linha tiver a palavra Musica no meio, substituir deixando apenas a palavra Musica. O "\1" corresponde ao grupo que foi encontrado entre parenteses na busca, que no caso é a palavra Musica. Os ".*" antes e depois da palavra significam qualquer caracter quantas vezes for, o que significa todo o resto da linha.
9 years ago @ Devin - Comandos de Tratamento... · 1 reply · +2 points
Since you have content after the three letters, you must also include them on your regular expression, like this:
grep -Pzo "(?s)^OXI\N+..H1\N+..H2\N+" input
The N+ after OXI/H1/H2 means any character that isn't a new line. So the regex says: "Find three consecutive lines beginning with OXI, H1 and H2."
You'll also want to convert the txt file to unix format for proper handling newlines with this regex:
dos2unix input
9 years ago @ Devin - Comandos de Tratamento... · 3 replies · +1 points
AA
BB
CC
Fonte: http://stackoverflow.com/questions/3717772/regex-...
9 years ago @ Devin - Programando em shell s... · 0 replies · +1 points