30 May
2018
30 May
'18
11:11 a.m.
Why not put it in ~/.profile? Or if it needs to be system wide, in /etc/profile.d/ip.sh? On 30/05/2018 13:07, Maykel Franco via arch-general wrote:
Hi, I put this text in /etc/environment:
$ source /etc/environment
ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
$ echo $ip
192.168.0.33
Works fine, but when I reboot my archlinux:
$ echo $ip
$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)
What's happened?? Is necessary exec source /etc/environment after every reboot?
Thanks in advanced.