What is a users default shell

>> Tuesday, 11 January 2022



username=myuser
out="$(grep "^${username}:" /etc/passwd)"
IFS=:
set -- ${out}
echo "Dir: $6"
echo "Shell: $7"



username=myuser
awk -v user=$username -F: '($1 == user) {print $6}' /etc/passwd










0 comments:


  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP