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

1 Answers1

0

You can read user input with the read command.

dialog --tailbox /etc/passwd 200 200
read -p "select user: " username
chfn "$username"
that other guy
  • 116,971
  • 11
  • 170
  • 194