Hi. I am just getting into scripting. I came into a situation where I need to go through several hundred files on a Linux system and find a couple specific bits of information from within each file. All the files have pretty much identical content except for a view data values on the same two lines in each file. I want to make a script that can go through them all and get each data value so I can manipulate them.
I know this is kind of a broad question, but I am really just trying to figure out where to get started. I am a bit of a Linux and programming novice, so I think this is going to be something difficult. Now I am reading about bash scripting from several different websites, but it seems like I might have to go through a lot of stuff and study for a few weeks before I can even accomplish something. I need to get this done much sooner than that.
Can anyone refer me to a good script site where I can dissect already made similar scripts or maybe a page that talks about file reading and manipulation scripts?
Any other kind of help is appreciated...
EDIT: I mean, what kind of commands would be wise to put in this script? Find? AWK?
from the "Gosh, you STILL learn things every day" department,
I never realised that you can have more than one search expression for grep, I'm sure I should have done, and should now feel stupid, but thank you anyway for today's lightbulb.
The file has a bunch of text and numbers but I just need to gather a number that is on like the 20th line of the file but the number is also after some text like this:
text file:
text
text
text
text
total numbers of something: 250900
total numbers of another thing: 750325
text
text
text
How do I get my script to go to those numbers? i will likely be putting them into a variable for computation and then so on for each file in the folder until they have all been gone through.