Answer the question
In order to leave comments, you need to log in
Enumerating and modifying files with a bash script?
Good afternoon.
There is a need to enumerate files (* .ini) in the directory with a bash script and add a certain line there. There is some text in the file, and also in some files there is a line that needs to be commented out, for example: Notify="notify/11111"
I have zero experience in bash scripts.
As I understand it, this can be done through a nested loop, but I did not think of how to do it.
All that was enough for me was just outputting files in a directory :)
find . -name "*.ini"
Answer the question
In order to leave comments, you need to log in
find . -regex ".*\.\ini" -exec sed -i 's/было/стало/g' "{}" \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question