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?