You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
243 B
Tcl

#!/usr/bin/env tclsh
set TTY [exec tty]
set PWD [exec pwd]
set HOST [exec hostname]
set IP [exec sh -c {ip -4 addr | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | sed -n '2p'}] ;# local ipv4 from ethernet or first down list
puts "$TTY $PWD $HOST $IP"