Trying to make a bash script that goes through directory files and changes things

I'm trying to write a script in a directory that goes through the column the user specifies of 4 files that are inside the directory and calculates the min and the max values. This means that if the user specifies column 5, the script will go through column 5 of all 4 files and all that should give only one min and one max. Then the script would subtract the min from the max and then divide that value by two (finding the average). It would then replace values in that same column the user inputed earlier for all 4 files that are less than the average AND greater than the min with �ttt� and ones that are greater than or equal to the average AND less than the max with �gcc�.

So far I've set up my script so that it checks the user input with this (giving the user an error if the number put is greater than 10)-

echo "Please enter a column you wish to change: "
read userinput
if [ ${userinput} -gt 10 ]; then
        echo "Error"
else

how do I continue with the rest of the script with searching the columns for min and max, and replacing the content of the files?

Please become accustomed to provide decent context info of your problem, like OS, shell, related environment, preferred tools, representative input sample, desired output, and the logics connecting the two.

Is this a homework / classroom problem? Homework and coursework questions can only be posted in this forum under special homework rules.

If this is NOT homework, please show us the background of the problem, e.g. the company branch / project you work for, or the type of research.

Thank You.

The UNIX and Linux Forums.

Ah okay, this is a homework assignment yes. My apologies. I'll delete this thread.