ls /sys/class/net | awk '{print $1}' | tail -n1
ls /sys/class/net | awk '{print $1}' | head -n1
yeilds
wlp3s0
eno1
How to make these variables? I've tried single quotes and double quotes around the whole. This is basically what I want;
wirelessname=ls /sys/class/net | awk '{print $1}' | tail -n1
wiredname=ls /sys/class/net | awk '{print $1}' | head -n1
echo "Wireless is ${wirelessname}"
echo "Wired is ${wiredname}"
Debian 12 on a Dell laptop, home network.
ls /sys/class/net | awk '{print $1}' | head -n1
yeilds
wlp3s0
eno1
How to make these variables? I've tried single quotes and double quotes around the whole. This is basically what I want;
wirelessname=ls /sys/class/net | awk '{print $1}' | tail -n1
wiredname=ls /sys/class/net | awk '{print $1}' | head -n1
echo "Wireless is ${wirelessname}"
echo "Wired is ${wiredname}"
Debian 12 on a Dell laptop, home network.