#!/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: # 09feb2026: Minor help section update # 10oct2025: Added CLIENT_NAME variable; removed finger dependency check # 27may2025: Minor help section updates, shebang # 07may2025: Added finger dependency check # 03may2025: Fixed client name; added nfoview check # 02may2025: Added piping support; better error handling # 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: nview user@domain.com [\"piping_command\"]" echo "" echo "Examples:" echo "" echo " nview @happynetbox.com" echo " nview user@happynetbox.com" echo " nview @plan.cat \"| head -n 20\"" echo " nview @plan.cat \"| grep -E 'Sun|Fri|Tue'\"" 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"