Trick at the end of "man 5 proc" doesn't work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

man 5 proc says:

> NOTES
>        Many strings (i.e., the environment and command line) are in the internal format, with subfields terminated by null bytes ('\0'),  so  you  may find that things are more readable if you use od -c or tr "\000" "\n" to read them.  Alternatively, echo `cat <file>` works well.

Unfortunately, echo `cat <file>` does not actually work:

$ echo `cat /proc/$$/environ`
bash: warning: command substitution: ignored null byte in input
LC_MESSAGES=en_US.UTF-8XDG_SEAT_PATH=...
(note that the null byte before XDG_SEAT_PATH has been just removed
without any substitution)

I suggest that the echo `cat <file>` trick should be dropped.

-- 
Alexander E. Patrakov




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux