LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-27-2006, 02:21 AM   #1
PLRCA2
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Rep: Reputation: 0
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
 
Old 10-27-2006, 02:55 AM   #2
PLRCA2
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Nvm, I found a solution. Ugly, but it works. Just echo the lines into another file and then execute that file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I install half windows98 half linux? xandar Linux - General 3 09-07-2005 03:23 AM
Half way there Newix LinuxQuestions.org Member Intro 2 07-29-2004 05:28 PM
Half-life Hilloki Linux - Games 4 04-25-2004 12:54 PM
Half-Life CD RussJB Linux - Software 1 11-17-2003 07:59 AM
Half way there! mrnikeswsh Linux - Security 3 08-27-2003 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration