Command syntax to modify multiple files
I have a program I use, rrdtool. I need to modify a ds value on every file at the same time. However, using a wildcard (*) to try this operation of all files does not work and instead only updates one file.
Here is the command syntax: rrdtool tune <file> --maximum traffic_in:100000000000 && rrdtool tune <file> --maximum traffic_out:100000000000 So, how can I do this on every file in the directory? |
Quote:
Code:
path="/path/of/interest" |
As I stated:
"However, using a wildcard (*) to try this operation of all files does not work and instead only updates one file." Buuut, how would I formulate said command? Thanks for your help. |
Quote:
|
Yes, I still don't understand.
path="/path/of/interest" find $path -type f | while read filepath do #your command here done Apply what solution? You didn't answer me completely. How do I specify the file name in the command? rrdtool tune ??? <-- what do I put here ... I hope I have been clear this time around. :) |
The name of the file would be stored in the variable $filepath, so you would write your command with $filepath wherever the filename argument should go.
Note that lutusp's solution will apply to all files in the specified directory and all its subdirectories, which may or may not be what you want. You can use: Code:
find $path -maxdepth 1 -type f | while read filepath |
All times are GMT -5. The time now is 09:39 PM. |