/etc/passwd and "&" char
jb.1234abcd at gmail.com
Mon Oct 29 08:28:29 UTC 2012
What is the purpose of the "&" char in GECOS fields, e.g. user's name field, in
/etc/passwd file ?
$ grep "&" /etc/passwd
The field containing "&" char represents "-c comment" option in pw(8), which
sets up GECOS fields (user's full name, etc).
The pw(8) states further:
The pw utility allows 8-bit characters in the passwd GECOS field ...
Using 8-bit characters may also affect other
programs that transmit the contents of the GECOS field over the Internet,
such as fingerd(8), and a small number of TCP/IP clients, such as IRC,
where full names specified in the passwd file may be used by default.
Encoding and display
The ampersand character is used as a special character in at least some
versions of the database software originally created in Denmark under the
name Navision (the software has since been acquired by Microsoft). Using this
character in either "Text" or "Code" fields could create difficulties for
performing certain tasks in Navision, such as filtering records (either by
the user or by programming). It is also used as described below to indicate
shortcuts in menu items and lab els.
In SGML, XML, and HTML, ... This creates what is known as the ampersand
Google search results for "& character":
Special (escape) characters in SGML, HTML and XML documents:
& & & ampersand
More information about the freebsd-questions