Answer the question
In order to leave comments, you need to log in
How to edit config files in BASH?
I have the following task:
There are many files (these are control files that are used to build deb packages) in which you need to edit one line (add dependencies)
, here is an example file:
Package: adfi
Version: 1.0
Section: utils
Priority: optional
Architecture: all
Depends: telnet, nmap, expect
Maintainer: Voropaev Dmitriy <[email protected]>
Description: ADFI - Utility to search the network for devices using standard login / password for telnet access.
Answer the question
In order to leave comments, you need to log in
Ansible doesn't work? There and work with lines and templates is. And in general, everything is simpler and YAML looks prettier.
You write a loop and inside it add the necessary information to all files in turn - grep, sed, awk, that's all. What is the difficulty?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question