;-) I was holding off trying to learn perl until I was proficient at shell! (BTW it looks scary!) Are you saying its easier to do it in perl or impossible to do it in ksh?
I figured something in awk might do it don't you think?
I had a really good photocopy from an old sco manual about awk. Lost...
Hi Neil, determined aren't you (thanks)
Hope this isn't too much info for you. At least you can get a better feel for what I'm TRYING to do ;-)
BTW IT IS actually slightly better formatted than you can see here.
This is what I get from your 2nd command
who -q | grep -v "#" | xargs finger -s |...
Your delimiters are a bit strange, its hard to understand your data, perhaps you might clarify what you see as an individual field. Are you using the colon to delimit your fields? All your records are all the same length. More info might help.
Hey there what happened to you guys, did you wimp out or did you just think I was being lame ;-) I probably was, I had to finish this in a hurry. Anyhow just to let you know, I might be slow but not stupid, so here's my answer:
PS I'm brand new to awk and sed and had to scratch my head but I had...
It looks like the who and the finger together are overkill, it seems to be resulting in duplicate lines. I've chopped off the who from the from the front (to the finger - even worse amputation) , now I get less lines than tty sessions. Perhaps theres a flag on finger...I'm gonna keep at it.
OK, I get it, if it doesn't look how you want you MAKE IT look like you want!
Ok so I'm trying to make it look nice and I have broken it!
I seem to have more lines comming back than user sessions %)
who |awk '{print $1}'|xargs finger -s|tail +2|sed -e 's/-/ /'|awk '{printf "%10s %10s %-8s...
Heres an example of what I get:
Login Name TTY
root Super-User console
root Super-User pts/2
root Super-User console
root Super-User pts/2
joe Joe Bloggs
I het joes last name not his tty... I want also want the * on the tty which says he's not accepting messages.
Hi Toolkit
Oh my God I've been laughing because I've never seen this tail +2, man page here I come.
It works except for real users (ie. non root) it gives me thier login name, first name and second name, but not their tty , (which I DO get for root)
which I expecially want as it is prefixed...
Hi there you guys ;-)
Im trying to get the first 3 fields from a finger -s command
I've tried using cut but that doesn't work.
who |cut -d" " -f1|xargs finger -s|cut -d" " -f1,2,3
The output of finger is seperated with multiple spaces. Do I used IFS again? How do I say my delimiter is junk...
Hi there and thanks to everyone who posted :-)
Ok I tried all the ideas except the perl one (only bcos I haven't got to perl yet!)
Looks like you guys have cracked it, I was obviously making it TOO complicated. I havn't used the pr command much so will be checking out the man page in a sec to...
Hi everyone
My head is getting to know the brick wall rather well by now.
My problem is all do to do with passing a list of files using the file command into a select loop. Now I can make the file command give me what I think works because I hard coded it into 2nd script, it doesn’t look pretty...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.