1. The problem statement, all variables and given/known data:
1)Write a shell script that can uses two types of files as inputs, apache.log and apache.error.log
2)Make it so that you can switch between the two file types
3)Make it so that the script writes the output in the terminal, and it is easily readable (use whitespace characters to separate the columns)
3. The attempts at a solution (include all code and scripts):
for task 2)
echo "What type of file's contents would you like for me to print? 1 - apache.log, 2 - apache.error.log"
case $NUM in
1) # Print out apache.log's contents ;;
2) # Print out apache.error.log's contents ;;
*) echo "INVALID INPUT!" ;;
I don't know how I could do task 3)
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Miskolc, Miskolc, Hungary, Smid László, GE-BGI
Not bad a start. You now could use shell functions to fulfill the 3rd requirement. I'm not sure what that exactly is, but just copying the files to the terminal might be missing it. Wouldn't it be helpful to provide small but representative samples of either log file if you need further assistance?
Do you want to read the log type from terminal, or do you want to pass it from the command line?
Do you know how to get at the script's positional parameters?
How would you describe the respective files' format, so it can be compared / controlled?