User Input
Hello, I'm Puriandrua and I'm new to the forums. I just had a simple quick question..
So I've completed a lab for a linux programming class I'm working on and looking at doing the extra credit which is taking input from the user in the .bat file I've created after slimming the file down and everything. Basically if the user inputs age 18 the .bat file will change it to 27 and eliminate or disallow any users named Chris. Can anyone help me with getting started or show me how to take user input in the .bat file? The code I have for my .bat file thus far is the following: Code:
grep Columbus custFile.txt | grep -v Chris | awk -F"," '{OFS="|"}{print$2,$1,$3,$4}' | sed 's/18/27/g' > import.txt Thanks in advance, Puriandrua |
Basically what it's doing so far is taking grabbing the file custFile.txt with only the columns that have 'Columbus' and then eliminating all of the 'Chris's' in the file, and changing the commas to pipes and I've eliminated the 5th column as it is of no use to what I'm doing, then change all age '18's to 27's and submitting it to a document called import.txt..
|
Oh, and basically what I'm looking for is when the script is run it should as the user something along the lines of "Would you like to filter a city?" and if the user answers yes, the script should ask what city they want to filter, otherwise if the user says no, then leave it alone.
|
ok I've decided to use it as an if then statement.
Code:
echo -n "Would you like to filter a city?" |
I'll answer with a question, can you tell me what the following line is doing (in your mind):
Code:
grep -i "$userInput" |
All times are GMT -5. The time now is 06:42 PM. |