I was working on parsing the output of popen
to lsof
and ps
.
I was wondering is the first and last column always left aligned? And the rest in between are always right aligned? And as seen in column FD
, is the minimum width of a column 3
?
For example:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\n
bash 252 noida cwd DIR 1,2 1088 410828 /Users/noida ion/Desktop\n
bash 252 noida txt REG 1,2 628736 11647 /bin/bash\n
bash 252 noida txt REG 1,2 622896 11866 /usr/lib/dyld\n
bash 252 noida txt REG 1,2 382100934 418209 /private/var/db/dyld/dyld_shared_cache_x86_64\n
bash 252 noida 0u CHR 16,0 0t401079 601 /dev/ttys000\n
bash 252 noida 1u CHR 16,0 0t401079 601 /dev/ttys000\n
bash 252 noida 2u CHR 16,0 0t401079 601 /dev/ttys000\n
bash 252 noida 255u CHR 16,0 0t401079 601 /dev/ttys000\n
0\u000b\u0001