Text parsing question
hi, I am trying to write a script for my router/firewall that parses from ifconfig output the ip address of a network adapter, merge the resuling IP with another file to generate a variable string and then pass that string to my firewall script. I have successfully extracted the IP address but am unable to get the variable string to generate properly, text is on two separate lines rather than the same line. In addition I have yet to find a way to insert the resulting variable string to the beginning of my firewall script. Any tips/ Suggestions? BTW running RegHat 9
ifconfig ppp0> /etc/ip/ipinfo
grep 'addr' /etc/ip/ipinfo > /etc/ip/ipinfo2
cut --characters=21-35 /etc/ip/ipinfo2 > /etc/ip/ipaddress
echo DSLIP= > /etc/ip/ipvar
cat /etc/ip/ipaddress >> /etc/ip/ipvar
Thanks
Bryan
|