Commit 1688abd3 authored by vagrant's avatar vagrant

done with question2

parent 9fd3e140
#!/bin/bash
declare -a users
declare -a homedir
users=($(awk -F: '{ print $1 }' /etc/passwd))
homedir=($(awk -F: '{ print $7 }' /etc/passwd))
for user in "${users[@]}"
do
if [ $user == $1 ]; then
echo "${homedir[$user]}"
break
else
echo "User $1 not found"
break
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment