i want a python equivalent of shell command cat logs/archived/app.2020-12-11* | grep "Sending" > sms_otp_logs_ack.log
I have tried by using sh module.
sh.grep(sh.cat(2020-12-18/100.6.13.16/app.*), string_to_grep)
This throws an error of no such file due to * wild card. How can i pypass this and also save the output to another file?
catis mildly useless here; like basically every properly written file manipulation tool,grepaccepts an arbitrary number of file name arguments, with the marked benefit that it can print which file it found a match in if you would like that.