#!/bin/bash # What a nice pice of shell-programing... thx to Chris F.A. Johnson @ comp.unix.shell is_ip() { case "$*" in ""|*[!0-9.]*|*[!0-9]) return 1Â ;; esac local IFS=. set -- $* [ $# -eq 4 ] && [ ${1:-666} -le 255 ] && [ ${2:-666} -le 255 ] && [ ${3:-666} -le 255 ] && [ ${4:-666} -le 254 ] } ip= until is_ip $ip; do echo -n "Please enter the highest ip in the range: " read ip done
Search
Categories