Added whereami reimplementation

master
Leo Coogan 4 years ago
parent cf2bc799b6
commit c0ff099e94
No known key found for this signature in database
GPG Key ID: B4F9BE9CF7FF8A5C

@ -0,0 +1,6 @@
#!/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"
Loading…
Cancel
Save