I'm trying to write a script which prints out the users who are loged in.
Printing the output of the "users" command isn't the problem. What I want is to filter out my own username.
users | grep -v (username)
does not work because the whole line in which username exists is suppressed.
If somebody knows the solution, please let me know.
But still there is the issue of filtering text from a string, so that you can print the rest of the string contents. Or the other way around. Printing just the text (or the word(s) that matches the search criteria) you're looking for.
If you ask me grep should do it. But extending grep is to mutch work (or perhaps I'm to lazy :)).
The challenge is to do this with a script.