From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29920 invoked from network); 8 Oct 2002 09:37:03 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Oct 2002 09:37:03 -0000 Received: (qmail 8557 invoked by alias); 8 Oct 2002 09:36:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5427 Received: (qmail 8537 invoked from network); 8 Oct 2002 09:36:29 -0000 Date: Tue, 8 Oct 2002 11:36:13 +0200 (CEST) From: =?ISO-8859-1?Q?Heinrich_G=F6tzger?= Sender: goetzger@exploding-systems.de Reply-To: =?ISO-8859-1?Q?Heinrich_G=F6tzger?= To: Bart Schaefer cc: zsh-users@sunsite.dk Subject: Re: exclamation mark expansion in shell command In-Reply-To: <1021002162312.ZM18476@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Bart, On Wed, 2 Oct 2002, Bart Schaefer wrote: > On Oct 2, 5:23pm, Heinrich G=F6tzger wrote: > } > } I'm looking without success yet for a simple way to prevent zsh to expa= nd > } my cmd arguments (including !) to my history. > > There are several ways. > > First, history is not expanded for words in single quotes: > > zsh% echo '!foo' > !foo This works fine. > > Second, you can disable history expansion for a single command line by > prefixing the line with !" like so: > > zsh% !" echo !foo > !foo > > Note that in all versions of zsh less than 4.1.0, the "magic-space" key > binding ignores the !" and still causes history to expand as you type. > (In fact, it'll erase the !" as soon as you type the space after it.) I'm using zsh 4.0.2 on Linux and if I type the line from the beginning, the described behavior occures. But If I edit the command line in a way that I add the !" at the beginning after typing the rest works as well. > Finally, you can `setopt nobanghist' to turn off all history expansion. This works very well as well. Thanks again. Heinrich