From owner-freebsd-questions Fri Jan 21 15: 8:59 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mx2.x-treme.gr (mx2.x-treme.gr [212.120.192.15]) by hub.freebsd.org (Postfix) with ESMTP id 5912E155F5 for ; Fri, 21 Jan 2000 15:08:48 -0800 (PST) (envelope-from keramida@diogenis.ceid.upatras.gr) Received: from hades.hell.gr (pat47.x-treme.gr [212.120.197.239]) by mx2.x-treme.gr (8.9.3/8.9.3/IPNG-ADV-ANTISPAM-0.1) with ESMTP id BAA23307 for ; Sat, 22 Jan 2000 01:08:39 +0200 Received: (from charon@localhost) by hades.hell.gr (8.9.3/8.9.3) id AAA01495 for freebsd-questions@freebsd.org; Sat, 22 Jan 2000 00:27:28 +0200 (EET) (envelope-from keramida@diogenis.ceid.upatras.gr) Date: Sat, 22 Jan 2000 00:27:28 +0200 From: Giorgos Keramidas To: freebsd-questions@FreeBSD.ORG Subject: Displaying `pwd` in sh(1) prompt? Message-ID: <20000122002728.B1387@hades.hell.gr> Reply-To: keramida@ceid.upatras.gr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i X-PGP-Fingerprint: 62 45 D1 C9 26 F9 95 06 D6 21 2A C8 8C 16 C0 8E X-Phone-Number: +30-94-6203692, +30-93-2886457 X-Address: Theodorou Kirinaiou 61, 26334 Patra, Greece Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm using bash when I'm logged in, but I really find it's memory consumption a bit too much. I changed to /bin/sh for a while, but I could not find any reasonable way of making my prompt something like: hostname!user:/current/path$ ... It seems that if I put in my .shrc the commands: PS1="`hostname`!$LOGNAME:`pwd`\$ " the prompt is fine, but when I change directories, the prompt stays unchanged, and the new `current' directory is not there. This is perfectly normal, since sh(1) expands `pwd` once when setting PS1. Is my only option a shell function like? cd () { chdir "$@" ; export PS1='blah blah'; } I tried looking in sh(1) manpage for anything like an escape sequence to put in the value of PS1, but I couldn't find anything helpful... -- Giorgos Keramidas, < keramida @ ceid . upatras . gr > "Don't let your schooling interfere with your education." [Mark Twain] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message