have to determine all users home directories - tilde scripting problem

后端 未结 6 1488
臣服心动
臣服心动 2021-01-03 04:04

Assume someuser has a home directory /home/someuser

NAME=someuser

In bash - what expression to I use combining tilde (~) and $NAME to return the users home d

6条回答
  •  北海茫月
    2021-01-03 04:58

    one alternative way

    awk -F":" '{print "user: "$1", Home directory is: "$6}' /etc/passwd
    

提交回复
热议问题