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
...
...
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
...
...
Comments
Post a Comment