zsh


Feb. 27, 2025

Useful .zshrc formulas for network engineers

Useful .zshrc formulas for network engineers mac will take a MAC address input and provide multiple formats for use on differing systems mac() { if [[ -z "$1" ]]; then echo "Usage: format_mac <MAC>" return 1 fi # Remove all non-hex characters mac=$(echo "$1" | tr -d ':-.') if [[ ${#mac} -ne 12 ]]; then echo "Invalid MAC address format." return 1 fi # Standard colon-separated format (AA:BB:CC:DD:EE:FF) mac_colon=$(echo "$mac" | sed 's/\(.