Originally Posted by amateurscripter
Sorry guys, these don't work b/c there's also an invisible character(^M) at the end of the line so using reg expersions is not an option. I can remove them for now but what happens later when someone else udates the file with (copy and paste mostly) with another invisible character for a different process name. I want the script to be general general solution not a specific case solution. how do i get grep to not return a result for the ".app1." match. That's where the issue is
I see where you're heading, but what exactly are the requirements? What invisible characters do you need to exclude, precisely?
If you want to allow any set of white space between "app1" and the end of the line, you can use this:
egrep -wi "app1[[:space:]]*$"
... which matches all lines ending with app1 followed by an arbitrary set of white-space characters.