10-24-2008
who - uniq output
Hi,
I'd like to have a script what takes the 'who' output and grabs the user names and outputs just the user name, and no duplicates.
I know I could do something like:
who | awk '{print $1}' | uniq -u
but I'd like to stay away from using the 'uniq' comand and just use awk.
Thanks
10 More Discussions You Might Find Interesting
1. HP-UX
All,
Can anybody provide me the links to the documentation on UniQPrint?
I need to prepare some documents to help my co-workers to learn UniQPrint.
Regards,
Vishal (0 Replies)
Discussion started by: vishal_ranjan
0 Replies
2. Shell Programming and Scripting
Hi,
I can't find how to achive such thing, please help.
I have try with uniq and comm but those command can't compare columns just whole lines,
I think awk will be the best but awk is magic for me as of now.
file a
a1~a2~a3~a4~a6~a7~a8
file b
b1~b2~b3~b4~b6~b7~b8
output 1:
compare... (2 Replies)
Discussion started by: pp56825
2 Replies
3. Shell Programming and Scripting
Hi
I am currently using uniq -u and uniq -d option in my program to get uniq and duplicate lines from file.
What i doing is
uniq -c file1>file_u
uniq -d file1>file_d
cat file_u file_d > file_fiinal
Since i am procesing a larger files the I/O operations is costly affair.
Hence I would... (0 Replies)
Discussion started by: dhanamurthy
0 Replies
4. Shell Programming and Scripting
Hi ,
Just to find out a way to compare these 2 files and give unique output.
For eg:
1.txt contains
1
2
3
4
5
6
--------------------------------------
2.txt contains
1
2
6
8 (1 Reply)
Discussion started by: rauphelhunter
1 Replies
5. UNIX for Dummies Questions & Answers
Dear all,
It's not entirely clear to me from manpage the difference between them.
Why we still need "-u" flag?
- monkfan (3 Replies)
Discussion started by: monkfan
3 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm having an consistency issue....
grep 'a' /usr/share/dict/words
1) This will highlight every 'a' in each word.
grep 'a\{1,\}' /usr/share/dict/words
2) This will highlight 'a' if it occurs at least once in a sequence. So every 'a'.
Output of 1) I would... (1 Reply)
Discussion started by: MykC
1 Replies
7. Shell Programming and Scripting
When I do uniq -c on a list of sorted numbers,
for eg:
1
1
2
2
2
3
3
4
It outputs 2 1
3 2
2 3
1 4.
Now, is there a way to sort on the column that "uniq -c" produced? (2 Replies)
Discussion started by: prasanna1157
2 Replies
8. UNIX for Dummies Questions & Answers
Hi, I have the following file called addresses, (it is a large file i have only copy and pasted few of the data below) and I am wanting to write a command so it will Find the ratio of mobile (07....) to land line (01....) telephone numbers?
then find the most popular first name and list the... (1 Reply)
Discussion started by: tina_2010
1 Replies
9. Shell Programming and Scripting
I have a master list of servers. I also have a list of servers I'm not supposed to touch. I'm trying to filter out the list servers that I'm not supposed to touch from the master list of servers, so I will have a "master list of servers I can touch". When I try to filter these I'm not getting... (4 Replies)
Discussion started by: MaindotC
4 Replies
10. Shell Programming and Scripting
hello
I want to check on first column duplicates and print the unique first and second columns
My trial output is not generating what I needed, i.e the second column.
thanks in advance (5 Replies)
Discussion started by: bhargavpbk88
5 Replies