0

Hi i am writing program which should change /etc/passwd file using chfn from file. Is it possible to run a file with bash file.txt with the command chfn there but for different user without editing file.txt. It should somehow let me to write user i want to edit name.

dialog --tailbox /etc/passwd 200 200
echo select user
chfn what should i do here
4

1 回答 1

0

read您可以使用该命令读取用户输入。

dialog --tailbox /etc/passwd 200 200
read -p "select user: " username
chfn "$username"
于 2013-10-24T00:00:04.023 回答