View Single Post
Old 24th August 2010
guitarscn guitarscn is offline
Package Pilot
 
Join Date: Oct 2008
Posts: 166
Default

Okay, I decided to make it a bit simpler, I have this so far:

Code:
#!/bin/bash
killall process1
#editing configs
process1 &
sleep 5
process2
The #editing configs part is the only part left. So this is what I need to get this script to do now:

The large file is in this format:
Code:
apple
banana
candy
...
[several hundred lines of this]
yoyo
zebra
1st config file:
Code:
option WORD1
otheroption blaha
moreoption blahb
2nd config:
Code:
name = { john }
colors = { red,blue }
options = { opt1 = WORD1; opt2 = WORD1; opt3 = WORD1; }
I need the instances where it says 'WORD1' in both config files to be edited and replaced with the line I choose from the large file list. So say I want the word 'candy' to be placed where 'WORD1' is, I would run the script with the number '3' because 'candy' is the 3rd word in the list. But if I run the script again though (in a new terminal window), I have to make sure that 'candy' is replaced by the next word/line I choose because I can't have it hanging around from my previous use of the script.
Reply With Quote