grep ^IPADDR= /etc/sysconfig/network-scripts/ifcfg-$devicename
Can i just do $devicename without any brackets? Because I'm having using a head -1 to read off the first line of the file which will than be append to the $devicename. But when I run it, it says grep: enp0s3: No such file or directory or grep: lo: No such file or directory