Okay this will probably have multiple parts to it but I don't really want to trouble you guys with more help because I'm a total noob so I can just do the first part by hand (it's just editing a few hundred lines of text in a file; I have to do the same thing on each line and I'm sure there's a scripted solution for it but I can spare a couple hours).

So basically I have a file with several hundred lines, and each line is only 2-3 words.

I need the script to do these things in order:

1) kill process1
2) put the 1st line of this file list into already existing text file #1 (requires root to write): the line it needs to write to is like: "option LINE1" where the 1st line has to be written where 'LINE1' is, somewhere in this text file
3) save this text file
4) put the 1st line of this file list into existing text file #2: the line is like "set = { opt1 = LINE1; opt2 = LINE1; opt3 = LINE1; }" and again I want the 1st line to be filled in all where 'LINE1' says
5) save text file
6) start process1
7) run a certain command in shell which will execute a CLI program and leave it running (I don't think it can be run in the background because I tried starting it with the '&' sign at the end and it ran but it didn't connect the way it properly was supposed to)
8) repeat but use the next line in the file list

What programming language would be the quickest and easiest way to write something like this? It doesn't have to be fancy or anything, just work even if it's dirty

I would highly recommend you implement this as a shell script, & I would further suggest it be done as a Bourne shell script. Most shells (Korn, Z, Bash, etc.) at a bare minimum support Bourne shell conventions, so in many ways it is the least common denominator solution. Bourne shell scripts will minimal changes should run on most shells.

A reasonable introduction to Bourne shell programming is the following:

Think of what standard commands can be used to accomplish each portion of the problem described.

Write it down & test. Confirm to yourself that the code does what you think it does.

When you get stuck, ask questions here, but help us understand what you have already done by describing the problem, describe what you think the solution might be, & describe what code you believe implements a working solution.

That page says the guide is obsolete and is only preserved for historical purposes. Should I use the recommended guide linked on that page?

I have a general idea of how to stop/run processes because I do that every day, so I guess the main chunk of this is editing the text files and putting in the words where they belong. Would sed/awk work? Or will this not achieve the desired results because they are only stream editors and do one pass and are not state machines? (I remember the last time I worked with sed/awk to make mass changes to a text file, I was very unhappy with using such complicated syntaxes and stuff)

That page says the guide is obsolete and is only preserved for historical purposes.

Updated. Thanks for pointing this out.

Quote:

Would sed/awk work?

Yes, but the overall solution may or may not be implemented solely in terms of one utility or the other. This is where you might need to write one portion in sed(1), another in awk(1), & glue everything together with sh(1).

When it comes to shell programming, sed(1) & awk(1) are indispensible.

For example, here's code I use within a shell script configuring a USB drive as a install medium (so I don't have to continually burn CD's...). Note that I have numerous subshells exploiting sed(1) & awk(1):

__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD

Very similar here...I've only used awk *very* sparingly because I never really took the time to learn it.

sed is a different story. I've studied it and learned quite a bit of what it can do, and I find it absolutely indispensable. I have used sed to save jobs before, and that's no joke (corrupted plain-text database dump that was "cleaned up" with a sed one-liner so it could be properly restored).

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.

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.

It sounds like you are concerned about losing data integrity if there are multiple instances of the script running simultaneously. If this is the case, look at one of Heiner's tricks posted on Shelldorado:

The #editing configs part is the only part left. So this is what I need to get this script to do now:

... snipped ...

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.

Script also doesn't delete the word from large_list (as you requested), but it should be fairly ease to do it.

__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD