# Future quote.....
# Not a real quote.
> Zoomers have always existed.
> typeset is a shell builtin that is POSIX, but Bash replaced typeset with
declare, but then set typeset as an alias. So POSIX scripts will work in Bash,
but a Bash script using declare not typeset, will not work in POSIX shell.
> You have to be an absolute cunt to do something like this.
Changed my default shell to match OpenBSD and to avoid bashisms whilst I'm learning to write scripts.
$ chsh void Changing shell for void. Password: New shell [/bin/bash]: /bin/ksh Shell changed. $_
#!/usr/bin/bash # Find hosts on LAN # Edit variables to suit your needs ################################### NETWORK="192.168.1" # SECS="0.2" # ################################### typeset -i i echo -e "\nPinging addresses 1 to 255\n" for (( i = 1 ; i<255 ; i++ )) ; do ip=$NETWORK.$i ping -c 1 -W $SECS $ip >/dev/null if [ $? == '0' ] then echo $ip exists fi done