![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
i was trying to work on program to look for users never log on sever.. using awk
with awk is working last| awk '{print $1}' |sort -u > /tmp/users1$$ cat /etc/passwd | awk -F: '{print $1}' |sort -u > /tmp/users2$$ comm -13 /tmp/users[12]$$ rm -f /tmp/users[12]$$ with cut it is not working last| cut -c1-10 |sort -u > /tmp/users1$$ cat /etc/passwd |cut -d':' -f1 | sort -u > /tmp/users2$$ comm -13 /tmp/users[12]$$ rm -f /tmp/users[12]$$ i have another idea by using for loop and count number users repeated. if anyone has better idea to solve this problem please help. |
|
||||
|
I love one-line commands.
![]() Code:
(last | awk '{print$1}'; awk -F: '{print$1}' /etc/passwd) | sort | uniq -u
|
| Sponsored Links | ||
|
|