C Shell history, backprimes Q's -- Noddy Level

Dave Gotwisner dig at peritek.UUCP
Sat Apr 15 18:23:08 AEST 1989


In article <4930001 at hpopd.HP.COM>, ian at hpopd.HP.COM (Ian Watson) writes:
> OK, a simple one from a neophyte...
> 
> I've just entered a command 'foo bar parm', when what I wanted was
> 'foobar parm'.  I've tried the history mechanism of the C Shell, but
> it seems obsessed with treating the erroneous command as a sequence
> of words, and so I can't seem to get the substitute to recognise
> 'o b', as this spans words.  The few Unix folks round here are all Korn
> shell users.  I refuse to change until I've sussed this one, as I'm too
> pigheaded.  I'm browned off with combos of '," and \ to quote that 
> damned space, what'm I doing wrong ?  Is there any 'conceptual user
> model' to the mechanism that'll give me an insight into how I might
> tackle such stumbling blocks logically in future ?

Try:

!:0!*

This will take argv[0] and concatinate it with argv[1],
adding the other arguments afterwords.  In otherwords,

	    argv[0] == foo
	    argv[1] == bar
	    argv[2] == parm

!:0 gives the 0'th arg
!* gives 1 - N

!:0!* gives "foobar parm"
-- 
------------------------------------------------------------------------------
Dave Gotwisner					UUCP:  ...!unisoft!peritek!dig
Peritek Corporation				       ...!vsi1!peritek!dig
5550 Redwood Road
Oakland, CA 94619				Phone: 1-415-531-6500



More information about the Comp.unix.questions mailing list