Can a command be stuffed into History?

J|rgen Jensen jensen at diku.dk
Mon Apr 15 08:45:47 AEST 1991


(I've directed followups to comp.unix.questions.)

asg at sage.cc.purdue.edu (Bruce Varney) writes:

  >In article <SQUASH.91Apr4184954 at heat.math.ufl.edu> squash at math.ufl.edu (Jonathan King) writes:
  >}Could some kind soul tell me how to write an alias (or a script)
  >}which, after having done something (eg. an lpr command)
  >}places on the history list, a particular command.
  >}  My intention is to later execute this command with !! .
  >}  If this cannot be done, is it possible to have the alias type a
  >}command to the Unix prompt, so that I can hit <CR> later to execute it? 
  >}
  >}Jonathan  squash at math.ufl.edu 
  >I believe ksh can do it
  >print -s whateveryouwantaddedtoyourhistorylist
  >hope this helps
  >			Bruce

In a non-wimpy csh:

    alias youralias 'yourcmd; echo yournextcmd > tmpfile; source -h tmpfile'
-- 

 . . . . . . . . . . . . . . . . . . . . . . . . . . j e n s e n
(jensen at diku.dk)
                        Opinions? -- These are rock-solid facts!



More information about the Comp.unix.wizards mailing list