I am creating a bash script that installed VSFTPD / FTP. After the installation some configuration is required in the /etc/vsftpd/vsftpd.conf file.This includes making sure the following lines are set to this:anonymous_enable=NOlocal_enable=YESchroot_local_user=YESWhat would be the best approach for scripting a way for these edits to be made post installation?
Editing lines in a file using a bash script?
linux;bash;shell script;centos
I would use sed it's really powerfull, this bash file would change the values:  #!/bin/bash  path_to_conf=/path/to/vsftpd.conf  anonymous_=NEIN  local_=JA  chroot_=IDK  sed -c -i s/\(anonymous_enable *= *\).*/\1$anonymous_/ $path_to_conf  sed -c -i s/\(local_enable *= *\).*/\1$local_/ $path_to_conf  sed -c -i s/\(chroot_local_user *= *\).*/\1$chroot_/ $path_to_confYou could use a loop to get this done, if you have to change a lot of variables, but with only three keys it's nicer like this (in my opinion).