samedi 18 septembre 2021

I'm facing some input issue here in bash scripting, it's basically in the if-else statement, all the script is running ok after the else statement

#!/bin/bash

if ["$1" == " "]

then echo "You forgot an ip address!" echo "Syntax:./ipsweep.sh 192.168.43"

else for ip in seq 1 254 ; do ping -c 1 "$1"."$ip" | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" & done

fi

Aucun commentaire:

Enregistrer un commentaire