Re: /proc/<pid>/cmdline

Jason Tyler (c9326542@sol.newcastle.edu.au)
Thu, 11 Jul 1996 16:15:45 +1000 (EST)


Alex asked:
: A brief observation that on my system, cat of /proc/<pid>/cmdline gives
: the cmdline minus spaces between the arguments. Is this correct,
: is my system in need of an upgrade somewhere, or is it an error?

It's correct. Pipe the cat to cat -v and you can see the NULLs between
the arguments, exactly as they are in argv[]:

~; cat /proc/248/cmdline | cat -v
xterm^@-ls^@-sl^@500^@-font^@7x13^@-sb^@-bg^@black^@-fg^@white

The obvious 'cat -v /proc/248/cmdline' doesn't work, not for me at
least -- anyone know why?

j