- rex.sh
#!/bin/ksh # rex is a tiny browser for nex # usage: rex [host] [selector] # example: rex nex.nightfall.city # rex nex.nightfall.city users/m15o/ # credit: nex://nex.nightfall.city/users/alexlehm/ if [[ ${#} -gt 2 ]] then echo "Usage: $0 [host] [selector]" exit 1 fi if [[ -n "$1" ]] then host="$1" else host="nightfall.city" fi if [[ -n "$2" ]] then ruta="$2" else ruta="/" fi echo "$ruta" | nc "$host" 1900 | less send() { msg="$1" echo $host echo $msg | nc $host 1900 | less } while true do echo -n "nex:" read input if [[ $input == "bye" ]] then exit 0 fi if [[ $input == "ruta" ]] then echo "$ruta" else send $input fi done
