Duda con condición BASH

Iniciado por .:UND3R:., 7 Noviembre 2013, 16:51 PM

0 Miembros y 1 Visitante están viendo este tema.

.:UND3R:.

Hola a todos, tengo el siguiente código:

Código (bash) [Seleccionar]
if [[ "$TARGET" =~ "$REPLY" ]];then
else
arpspoof -i "$INTERFACE" -t "$REPLY" "$ROUTER_INET_IP" 2> /dev/null &
arpspoof -i "$INTERFACE" -t "$ROUTER_INET_IP" "$REPLY" 2> /dev/null &
TARGET=${TARGET}" "$REPLY
echo "IP:$REPLY"
let "COUNT += 1"
fi


Cómo podría hacer para eliminar el else, entiendo que debo negar la condición, pero no lo logro:
Código (bash) [Seleccionar]
!=~

o con

Código (bash) [Seleccionar]
]if [![ "$TARGET" =~ "$REPLY" ]];then

Saludos

Solicitudes de crack, keygen, serial solo a través de mensajes privados (PM)

-Myx-

1-usar doble quotes (") no es necesario si usas "[["
2-Usa "!" asi: stackoverflow.com/questions/4542732/how-do-i-negate-a-test-with-regular-expressions-in-a-bash-script
Código (bash) [Seleccionar]
if [[ ! $TARGET =~ $REPLY ]];then
3-tambien podrias usar ":" en el true del if sin cambiar nada mas del codigo
stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin

.:UND3R:.

Me ha quedado todo muy claro, muchísimas gracias. Cierro el post, saludos

Solicitudes de crack, keygen, serial solo a través de mensajes privados (PM)