Link to home
Start Free TrialLog in
Avatar of JPERKS1985
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?
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial