wasteland.cc


Notes to myself.

03-May-24

# Future quote.....
# Not a real quote.

02-May-24

IRC

> 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.


Set default shell to ksh in Void Linux

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.
$_

A script to find IP addresses of hosts on my network

#!/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