<div dir="ltr">No caso de string troca "==" por "="<div><br></div><div><p style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium"></p><table border="1" width="100%" height="100" cellpadding="1" cellspacing="1">
<tbody><tr><td align="center" bgcolor="#808080"><b>Mathematical Operator in Shell Script </b></td><td align="center" bgcolor="#808080"><b>Meaning</b></td><td align="center" bgcolor="#808080"><b>Normal Arithmetical/ Mathematical Statements</b></td>
<td colspan="2" align="center" bgcolor="#808080"><b>But in Shell</b></td></tr><tr><td> </td><td> </td><td> </td><td bgcolor="#C0C0C0" align="center"><b>For test statement with if command</b></td><td bgcolor="#C0C0C0" align="center">
<b>For [ expr ] statement with if command</b></td></tr><tr><td>-eq</td><td>is equal to</td><td>5 == 6</td><td>if test 5 -eq 6</td><td>if [ 5 -eq 6 ]</td></tr><tr><td>-ne</td><td>is not equal to</td><td>5 != 6</td><td>if test 5 -ne 6</td>
<td>if [ 5 -ne 6 ]</td></tr><tr><td>-lt</td><td>is less than</td><td>5 < 6</td><td>if test 5 -lt 6</td><td>if [ 5 -lt 6 ]</td></tr><tr><td>-le</td><td>is less than or equal to</td><td>5 <= 6</td><td>if test 5 -le 6</td>
<td>if [ 5 -le 6 ]</td></tr><tr><td>-gt</td><td>is greater than</td><td>5 > 6</td><td>if test 5 -gt 6</td><td>if [ 5 -gt 6 ]</td></tr><tr><td>-ge</td><td>is greater than or equal to</td><td>5 >= 6</td><td>if test 5 -ge 6</td>
<td>if [ 5 -ge 6 ]</td></tr></tbody></table><p></p><p style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium"><b>NOTE:</b> == is equal, != is not equal.<br></p><p align="center" style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">
<b>For string Comparisons use</b><br></p><table border="1" width="73%" align="center" cellspacing="1" cellpadding="1" style="font-family:'Times New Roman'"><tbody><tr><td width="24%" align="center" bgcolor="#C0C0C0">
<b>Operator</b></td><td width="76%" align="center" bgcolor="#C0C0C0"><b>Meaning</b></td></tr><tr><td width="24%">string1 = string2</td><td width="76%">string1 is equal to string2</td></tr><tr><td width="24%">string1 != string2</td>
<td width="76%">string1 is NOT equal to string2</td></tr><tr><td width="24%">string1</td><td width="76%">string1 is NOT NULL or not defined </td></tr><tr><td width="24%">-n string1</td><td width="76%">string1 is NOT NULL and does exist</td>
</tr><tr><td width="24%">-z string1</td><td width="76%">string1 is NULL and does exist<br><br></td></tr></tbody></table></div></div><div class="gmail_extra"><br clear="all"><div><br><br><div><p style="margin-top:0px;margin-right:0px;margin-bottom:8px;margin-left:0px;text-align:left">
<strong style="font-size:13.3px;font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:verdana,geneva">Maurício Magalhães.<br></span></strong><span><font color="#888888" face="arial, sans-serif">Analista de Rede e Segurança.<br>
ITIL® V3 Certification,</font><br></span></p><div style="text-align:left"><font face="Verdana, Arial, Helvetica, sans-serif"><br></font></div><p></p></div></div>
<br><br><div class="gmail_quote">Em 12 de agosto de 2014 22:46, Mauricio Magalhães <span dir="ltr"><<a href="mailto:mauriciommagalhaes@gmail.com" target="_blank">mauriciommagalhaes@gmail.com</a>></span> escreveu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Desculpe me enganei tenta no lugar de "==" use -eq<div><br></div><div>Abs</div></div><div class="gmail_extra">
<div class=""><br clear="all"><div><br><br><div><p style="margin-top:0px;margin-right:0px;margin-bottom:8px;margin-left:0px;text-align:left">
<strong style="font-size:13.3px;font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:verdana,geneva">Maurício Magalhães.<br></span></strong><span><font color="#888888" face="arial, sans-serif">Analista de Rede e Segurança.<br>
ITIL® V3 Certification,</font><br></span></p><div style="text-align:left"><font face="Verdana, Arial, Helvetica, sans-serif"><br></font></div><p></p></div></div>
<br><br></div><div class="gmail_quote">Em 12 de agosto de 2014 22:34, Mauricio Magalhães <span dir="ltr"><<a href="mailto:mauriciommagalhaes@gmail.com" target="_blank">mauriciommagalhaes@gmail.com</a>></span> escreveu:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Vc ta invertendo,<div><br></div><div>o correto é = <span style="font-family:arial,sans-serif;font-size:12.727272033691406px">"$teste" == "PRI span 1/0: In Alarm, Up, Active" (Se for diferente da string CORRETA"</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">ENTÃO OI OFF</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">SENÃO OI ON</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">aBS</span></div>
</div><div class="gmail_extra"><br clear="all"><div><br><br><div><p style="margin-top:0px;margin-right:0px;margin-bottom:8px;margin-left:0px;text-align:left"><strong style="font-size:13.3px;font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-family:verdana,geneva">Maurício Magalhães.<br>
</span></strong><span><font color="#888888" face="arial, sans-serif">Analista de Rede e Segurança.<br>ITIL® V3 Certification,</font><br></span></p><div style="text-align:left"><font face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></div><p></p></div></div>
<br><br><div class="gmail_quote">2014-08-12 21:50 GMT-03:00 Eder MC <span dir="ltr"><<a href="mailto:eder.alem@gmail.com" target="_blank">eder.alem@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
<div>Ola galera</div><div> </div><div>estou tentando fazer um script para testar e fazer algo caso meu E1 pare.</div><div> </div><div>##!/bin/bash<br>teste= asterisk -rnx "pri show spans"<br>echo $teste<br>if [ "$teste" == "PRI span 1/0: In Alarm, Down, Active" ];<br>
then<br> echo "OI OFF"<br> else<br> echo "OI ON"<br> fi<br></div><div> </div><div>copiei a string de acordo com o comando, porem ele passa como OK...sendo que ta OFF</div><div> </div><div> </div>
<div>vlw</div>
<br></div></div>_______________________________________________<br>
<br>
WORKOFFEE KHOMP: Eventos Khomp na sua cidade! Desenvolva seu<br>
conhecimento na tecnologia e portfólio Khomp. Próxima edição<br>
em CURITIBA, 7 de agosto. Inscrições GRATUITAS.<br>
Garanta a sua vaga e saiba mais em: <a href="http://www.workoffee.com.br" target="_blank">www.workoffee.com.br</a><br>
_______________________________________________<br>
<br>
ALIGERA – Fabricante e desenvolvedor nacional de Soluções para telefonia IP .<br>
Gateway Sip, Placas de 1E1, 2E1, 4E1 e 8E1 para PCI ou PCI Express.<br>
Banco de Canais Analógicos – Appliance Asterisk<br>
Acesse <a href="http://www.aligera.com.br" target="_blank">www.aligera.com.br</a><br>
_______________________________________________<br>
Para remover seu email desta lista, basta enviar um email em branco para <a href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org" target="_blank">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a><br></blockquote>
</div>
<br></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div>