shell-script-pt
[Top][All Lists]
Advanced

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

Re: Substituição de valores por * após um padrão


From: Raul Libório
Subject: Re: Substituição de valores por * após um padrão
Date: Thu, 28 Nov 2019 00:40:05 -0300

Corrigindo, o padrão que procuro é:

email + dois pontos ( : ) + dois primeiros caracteres da senha + o
resto dos caracteres substituídos por asterisco.

Ficou implicito nos exemplos, mas melhor detalhar :)

Em qui., 28 de nov. de 2019 às 00:37, Raul Libório
<address@hidden> escreveu:
>
> Amigos, confesso que já exauri minhas tentativas :)
>
> Tenho um arquivo.txt com o seguinte texto: (exemplo)
> address@hidden:minhaSenha
> address@hidden:minhaSen21hadasa
> address@hidden:minheweqwaSenhddaa
> address@hidden:xadaeeminhaSenha
> address@hidden:minhd231231aSe1nha
>
> O que preciso?
> Que a saída seja:
> email + dois pontos ( : ) + dois primeiros caracteres da senha. Algo assim:
>
> address@hidden:mi********
> nhaSenha = 8 caracteres, 8 asteriscos
>
> Tentei por exemplo, sed -r 's/:(..)+/\:\1*****/g' pass.txt
> porém aqui eu estou definindo a quantidade de asteriscos que serão
> impressos. O que não é procuro.
>
> Tentei salvar os valores depois do padrão em um segundo grupo, e
> depois substituir os valores desse segundo grupo pelos asteriscos, mas
> não consegui fazer isso. =\
>
>
>
>
> --
> Raul Libório
> http://rauhmaru.blogspot.com/
> openSUSE Member | Linux User #4444581
>
> /etc/httpd/conf.d/ssl.conf:7
> # Do NOT simply read the instructions in here without understanding
> # what they do.  They're here only as hints or reminders.  If you are unsure
> # consult the online docs. You have been warned.



-- 
Raul Libório
http://rauhmaru.blogspot.com/
openSUSE Member | Linux User #4444581

/etc/httpd/conf.d/ssl.conf:7
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]