From owner-freebsd-questions@FreeBSD.ORG Mon Oct 29 08:31:55 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BE63F2F for ; Mon, 29 Oct 2012 08:31:55 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id C3B428FC08 for ; Mon, 29 Oct 2012 08:31:54 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.5/8.14.5) with ESMTP id q9T8Vong061806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Oct 2012 09:31:50 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.5/8.14.5/Submit) with ESMTP id q9T8VoHG061803; Mon, 29 Oct 2012 09:31:50 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Mon, 29 Oct 2012 09:31:50 +0100 (CET) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: jb Subject: Re: /etc/passwd and "&" char In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-2142601691-1351499510=:26470" X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 08:31:55 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-2142601691-1351499510=:26470 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Mon, 29 Oct 2012 08:28-0000, jb wrote: > Hi, > > Question: > What is the purpose of the "&" char in GECOS fields, e.g. user's name field, in > /etc/passwd file ? > > $ grep "&" /etc/passwd > root:*:0:0:Charlie &:/root:/bin/csh > operator:*:2:5:System &:/:/usr/sbin/nologin > svn:*:1002:1002:User &:/home/svn:/usr/sbin/nologin >From passwd(5): The full name may contain a ampersand (`&') which will be replaced by the capitalized login name when the gecos field is displayed or used by vari- ous programs such as finger(1), sendmail(8), etc. > 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. > ... > > http://en.wikipedia.org/wiki/Ampersand > ... > Encoding and display > ... > Programming languages > ... > 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. > ... > Text markup > In SGML, XML, and HTML, ... This creates what is known as the ampersand > problem. ... > ... > Unix shells > ... > Web standards > ... > > Google search results for "& character": > Special (escape) characters in SGML, HTML and XML documents: > & & & ampersand > > jb -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-2142601691-1351499510=:26470--