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

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

Re: Problema com redirecionamento stderr dpkg-query


From: vitalino . victor
Subject: Re: Problema com redirecionamento stderr dpkg-query
Date: 03 Jan 2015 08:43:45 -0800

Obrigado Paulo Bettenga e Sidney Souza pelas contribuições.
De fato as soluções de vocês são mais simples e contornam meu problema.






---Em address@hidden, <phfbettega@...> escreveu:

Olá Vitalino, não tenho um Debian instalado pra testar,
mas essa função não poderia ser mais simples?

function VerificaSafenet {
grep -q ' install' <<<"$(grep -A1 "Package: $1" /var/lib/dpkg/status)" && echo 0 || echo 1
}

On 02-01-2015 23:12, vitalino.victor@... [shell-script] wrote:
> Olá pessoal!
>
>
> function VerificaSafenet {
>
> VAR=$(grep -A1 "Package: $1" /var/lib/dpkg/status; if [ $? -ne 0 ]; then echo '-1'; fi)
>
> if [ "$VAR" -ne '-1' ]; then
>
> echo $VAR | grep ' install' > /dev/null 2>&1
>
> if [ $? -eq 0 ]; then
>
> echo 0
>
> else
>
> echo 1
>
> fi
>
> fi
>
> }
>
>
>
>
>
>
> []'s
>
> Vitalino Victor
>
>
>
>
> ----------------------------------------------------------------------------------------------------
> Enviado por: vitalino.victor@...

reply via email to

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