how to print output of a command linux 1

how to print output of a command linux

printf "$dir1 $dir2 $(tail -n -1 pes.log) \n" >> ../opt_done.txt 

Here is what the above code is Doing:
1. It’s creating a directory for each of the two directories that we want to compare.
2. It’s creating a file called pes.log in each of those directories.
3. It’s running the command “python pes.py” in each of those directories.
4. It’s appending the output of the pes.py script to the pes.log file in each directory.
5. It’s appending the output of the pes.py script to the opt_done.txt file in the parent directory.

Similar Posts