-aux errors for me, here's what I have now
ps | awk ' /program/ {print $1} '
This is outputting the PID, isn't there a way to store the number in a variable rather than print it, maybe then pipe it into a kill? I'm not sure of the syntax I guess.
edit: I meant to say via exit command in the title.
edit2: no longer relevant
edit3: break; I gotta start dumbing myself down, or reading more before trying to code.
But, pretend this was to do something other than break a loop., Let's say I am trying to find out how many times someone has logged into the machine. Use last to display all the different logins, several names pop up, some multiple times. This is something else I was working on, all I can figure out is the total number of logins, but I can't determine how to compare if $1(user name) is there more than once, and ontop of that count it if it is.
ex.
toyoung
rasmith
toyoung
output i'm looking for would be
toyoung 2
rasmith 1
here's what i have:
last | awk ' END {print "Number of logins:", NR} '