0

The below bash commands are used to create a directory and the creating a logfile in the above created directory along with some text inserted in to that log file.

My question is, how can we execute the below two cmds in python.

mkdir -p /var/remediation_log
echo $timestamp "some text" >> /var/remediation_log/$date.text.log
  • 2
    Try google first to solve your issues : https://www.google.com/search?q=python+how+to+execute+bash+command&oq=python+how+to+execute+bash – azro May 06 '21 at 10:32
  • Also all of that can do with python code, that oculd be nicer to read – azro May 06 '21 at 10:33

0 Answers0