Monday, December 15, 2014

Quickie user list.

Need to know the users on a system, then try this:


lsuser.sh
[code]
#=================================
# lsuser - list users
#=================================
# Assignments
# --------------------------------
datafile="/etc/passwd"
# end assignments
#=================================
#
# Data input
#---------------------------------
while read line
do echo $line | cut -d: -f1
done < $datafile
[/code]

$ chmod +x lsuser.sh

$ ./lsuser.sh
...
...
john
michael
...
...

No comments:

Post a Comment