From owner-freebsd-doc@freebsd.org Sat Jul 4 05:37:20 2015 Return-Path: Delivered-To: freebsd-doc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1083A995C48 for ; Sat, 4 Jul 2015 05:37:20 +0000 (UTC) (envelope-from mike@skew.org) Received: from chilled.skew.org (chilled.skew.org [70.90.116.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.skew.org", Issuer "AlphaSSL CA - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E28FD1B48 for ; Sat, 4 Jul 2015 05:37:19 +0000 (UTC) (envelope-from mike@skew.org) Received: from chilled.skew.org (localhost [127.0.0.1]) by chilled.skew.org (8.14.7/8.14.7) with ESMTP id t645bHrM022188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 3 Jul 2015 23:37:18 -0600 (MDT) (envelope-from mike@chilled.skew.org) Received: (from mike@localhost) by chilled.skew.org (8.14.7/8.14.7/Submit) id t645bHva022187 for freebsd-doc@freebsd.org; Fri, 3 Jul 2015 23:37:17 -0600 (MDT) (envelope-from mike) Date: Fri, 3 Jul 2015 23:37:17 -0600 From: Mike Brown To: freebsd-doc@freebsd.org Subject: sh(1) man page suggestion: prompt string syntax Message-ID: <20150704053717.GA21782@chilled.skew.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Whoa: whoa. User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2015 05:37:20 -0000 I was having trouble finding out what escape codes are valid in an sh(1) prompt. The man page does not say, so I looked at /usr/src/bin/sh/parser.c and determined what the options are. Please consider adding this info to the man page, /usr/src/bin/sh/sh.1 : A prompt string must be less than 128 characters. All characters are output verbatim, except these sequences: '$' is replaced with '#' if the user is root. '\h' is replaced with the local hostname. '\H' is replaced with the fully-qualified hostname. '\W' is replaced with the working directory. '\w' is replaced with the full path of the working directory.