#!/usr/bin/env bash # This script is licensed under the Blue Oak Model License 1.0.0. # See: https://blueoakcouncil.org/license/1.0.0 # Changelog: # 3.0 (10oct2025) - Added CLIENT_NAME variable; removed finger dependency check # 2.3 (27may2025) - Minor help section updates, shebang # 2.2 (07may2025) - Added finger dependency check # 2.1 (03may2025) - Fixed client name; added nfoview check # 2.0 (02may2025) - Added piping support; better error handling # 1.0 (01may2025) - Initial release # --------------------------------------------------------------------------- CLIENT_NAME="finger" if ! command -v nfoview > /dev/null; then echo "Error: nfoview is not installed. Please install it first." exit 1 fi if [ -z "$1" ]; then echo "" echo "nview - view finger output in NFO Viewer with optional piping" echo "" echo "Usage: $0 user@domain.com [\"piping_command\"]" echo "" echo "Examples:" echo "" echo " $0 @happynetbox.com" echo " $0 user@happynetbox.com" echo " $0 @plan.cat \"| head -n 20\"" echo " $0 @plan.cat \"| grep -E 'Sun|Fri|Tue'\"" echo "" echo "Install: chmod +x nview && sudo cp nview /usr/local/bin" echo "Uninstall: sudo rm /usr/local/bin/nview" echo "" echo "Uses: Your favorite finger client via 'CLIENT_NAME' variable" echo "Requires: nfoview (https://otsaloma.io/nfoview/)" echo "Note: Second argument is a shell pipeline (in quotes)" echo "Note: Output saved to a temp .nfo file (auto-deleted)" echo "" echo "$(tput bold)Visit: https://640kb.neocities.org/fingerverse for more clients$(tput sgr0)" echo "" exit 1 fi TARGET="$1" PIPING_CMD="${2:-}" tmpfile=$(mktemp /tmp/${CLIENT_NAME}_output.XXXXXX.nfo) trap 'rm -f "$tmpfile"' EXIT if [ -z "$PIPING_CMD" ]; then $CLIENT_NAME "$TARGET" > "$tmpfile" else eval "$CLIENT_NAME '$TARGET' $PIPING_CMD" > "$tmpfile" fi if [ ! -s "$tmpfile" ]; then echo "Error: No output generated (invalid target or filter?)" exit 1 fi nfoview "$tmpfile"