JPERKS1985
asked on
fix this shell script
I have the below shell script
FILE=$1;
i=5
for ip in 'cat $FILE'
do
i='expr $i + 1'
/sbin/ifconfig eth0:$i $ip netmask 255.255.255.0
/sbin/route add $ip eth0:$i
done
This should go through a fileand bind each line (IP) to the eth0. However its not working. I believe the script is fine but how should I call it from the terminal?
FILE=$1;
i=5
for ip in 'cat $FILE'
do
i='expr $i + 1'
/sbin/ifconfig eth0:$i $ip netmask 255.255.255.0
/sbin/route add $ip eth0:$i
done
This should go through a fileand bind each line (IP) to the eth0. However its not working. I believe the script is fine but how should I call it from the terminal?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.