1

Edit a file via bash script

view story
linux-howto

http://serverfault.com – I am a beginner in bash scripting.I want to create a bash script to install install and configure stuffs on my linux box in an automated way. Suppose i want to edit /etc/yum.repos.d/epel.repo by the bash script What i want to do is as follows Open file /etc/yum.repos.d/epel.repo Find [epel] section Add a line priority=10 just after line enabled=1 in the epel section For the first part i added yum install nano nano /etc/yum.repos.d/epel.repo My Question is how to do the 2 and 3rd part with bash script using nano (if possible , in case not possible then show me with sed) Also at (HowTos)