I am relatively new to Bash, regular expression and stuff.In a directory, I need to read the last line of all the files that contain the word fitness, and list (on one line and separated with comas) the first element of these last lines (where elements are defined by spaces), whenever the second element (or any element actually) is not 100000.tail -n 1 *fitness* | grep -v '100000' | grep -v 'fitness' | awk '{print $1}' | grep -v '^$' | paste -d  , - - - - - - - - - - - - - - - - -In words:read all last lines | don't consider those that contain the number 100000 | remove the name of the files | take the first element | remove blank lines | paste the element together on one line separated by comasCan you help me to improve my code?
Print first element of the last line of files when the second element does not match a pattern
regex;bash;awk