Hi, how to I can read in safe mode, from bash, the content of /proc/locks? On my system I have more than 7000/9000 line into /proc/locks and if I read it with awk (or cat or grep or cp) the file change during the read and my input is undefined and is not processable (see attach). My target is read if a process lock a specific files (through its i-node) Someone can suggest me some kind of solution? Many thanks? -- Dario Lesca <d.lesca@xxxxxxxxxx>
[root@host tmp]# awk 'NF!=8{print $0}' /proc/locks 753: POSIX ADVISORY RE ADVISORY READ 28710 08:21:4033908 2147483646 2147483646 33646 2147483646 4083: POSIX ADVISORY READ 30177 08:21:234624212147483646 2147483646 4141: POSIX A ADVISORY READ 10060 08:21:38488232 2147483646 2147483646 4242: POSIX ADVISORY WRITE 22794 fd:00:8610665 1177483646 4964: POSIX ADVISORY READ 26859 fd:00:8610674 218610665 81968 81968 [root@host tmp]# awk 'NF!=8{print $0}' /proc/locks 3 1236ORY READ 5438 08:11:656005 2147483646 2147483646 1745: POSIX ADVISOREAD 21580 08:21:1016440 2147483646 2147483646 2106: POSIX ADVISORY READ 6791 08:21:2572556 2147483646147483646 2977: POSIX ADVISORY DVISORY READ 27026 08:21:30442412 2147483646 2147483646 3079 ADVISORY READ 7743 08:21:9044011 2147483646 2147483646 3151: POSIX ADVISORY READ 5208 08:21:31490441 214748363646 3209: POSIX ADVISORY READ 4472 08:21:33686184 2147483646 21474846 2147483646 3678: POSIX ADVISORY READ 25376 08:21:26362714 1 2147483646 2147483646 3793: POSIX ADVISORY READ 235468:21:32474726 2147483646 2147483646 4184: POSIX ADVISORY READ 12598 fd:00:8610665 2147483646 2420 804420 4549: POSIX ADVISORY READ 17993 08:21:393646 2147483646 4594: POSIX ADVISORY R ADVISORY READ 21663 08:21:30507841 2147483646 2147483646 4608: POSIX ADVISORY READ 26557 08:21:40829334 2147483646 2147483DVISORY READ 9546 08:21:24461636 2147483646 214748 3646 5081: POSIX ADVISORY READ 28760 fd:00:8610665 2147483646 2147482: POSIX ADVISORY READ 28102 fd:00:8610674 21474836 46 2147483646 5202: POSIX ADVISORY READ 13321 fd:47483646 2147483646 5261: POSIX ADVISORY READ 26557 08:21:26557 08:21:40829345 2147483646 2147483646 5436: POSIX ADVISORY READ 4644 fd:00:8610665 21474883646 5615: POSIX AD 7204 fd:00:8610665 2147483646 2147483646 [root@host tmp]# awk 'NF!=8{print $0}' /proc/locks 245 ADVISORY READ 22358 fd:00:8610674 2147483646 2147483646 2571: POSIX ADVISORY READ 25681 08:21:26362713 880 2147483646 2147483646 3503: POSIX ADVISORY Y READ 813 08:21:26362714 2147483646 2147483646 3721: POSIX ADVISORY READ4094 fd:00:8610665 2147483646 2147483646 4141: POSIX ADVISORY READ 10060 08:21646 2147483646 4185: POSIX ADVISORY REIX ADVISORY READ 13404 08:21:1360328 2147483646 2147483646 4669:EAD 21663 08:21:30507363 2147483646 2147483646 4787: POSIX ADVISORY READ 21544 08Y READ 21544 08:21:39567804 2147483646 2147483646 4905: POSIX ADVISORY REA610674 2147483646 2147483646 4965: POSIX ADVISORY WRIIX ADVISORY WRITE 26469 fd:00:8610665 18748 18748 5203: POSIX ADVISORY READ 31657 fd:E 31657 fd:00:8610665 18966 18966 5261: POSIX 26557 08:21:40829335 2147483646 2147483646 5320: POSIX ADVISORY READ 9546 08:21:244619346 08:21:24461900 2147483646 2147483646 5364: PO 5855 08:21:16023796 2147483646 2147483646 5378: POSIX ADVISORY READ 5855 08:21:15978566 214748364147483646 5483: PORY READ 30648 fd:00:8610674 2147483646 2147483646 5498: POSIX A 5555: POSIX ADVISORY READ 2109708:21:20201483 2147483646 2147483646 5734: POSIX A758 08:21:26117116 2147483646 2147483646 5850: POSIX ADVISORY READ 22680 fd:00:8610674 2147483646 2POSIX ADVISORY READ 22680 fd:00:8610674 2147483646 21474 83646 [root@host tmp]#
-- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel