Half command constant half reiterated?
I'm not really sure how to ask this question in words, so I'll just give examples.
the command I want to run is:
ip route add default scope global \
nexthop via (IP address 1) weight 1 \
nexthop via (IP address 2) weight 1 \
...
I am attempting to make a script that will add the "nexthop via (IP address) weight 1" part an arbitrary number of times. Failed method so is:
ip route add default scope global \
for i in `seq 1 n`;
do
nexthop via (IP address) weight 1 \
done
The preceeding gives the error " nexthop: command not found"
Any ideas?
Thanks
|