I have a weird problem. I need to print out an output string from the stat command.
I've written the code that obtains some of the info.
import glob
import os
for file in glob.glob('system1/**', recursive=True):
os.system("stat -c \"set_metadata(/%n \"uid\", %u, \"gid\", %g, \"mode\", 0%a, \"capabilities\", 0x0, \"selabel\", \"later\");\" "f"{file}")
Expected output:
set_metadata("/system1/xbin/jack_transport" "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "later");
But my output looks like this:
set_metadata(/system1/xbin/jack_transport uid, 0, gid, 2000, mode, 0755, capabilities, 0x0, selabel, later);
It did not print a single " in there. Why so? i have tried replacing " with ' and that works but that's not what I need.