Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!unido!sapwdf!wohler From: wohler@sapwdf.UUCP (Bill Wohler) Newsgroups: comp.unix.shell Subject: printing ksh history a la csh Message-ID: <2582@sapwdf.UUCP> Date: 12 Feb 91 15:41:11 GMT Reply-To: Bill Wohler Organization: SAP AG, Walldorf, Germany Lines: 21 folks, in ksh, i'd like to say "history 30" to print the last 30 commands as in csh. if you know how to do this, i would be obliged. the problem is that the "fc -l" command optionally asks for the first and last command of your list. there aren't any variables that i know of that contain the current history number which one could subtract 30 from and pass to fc -l. another "feature" of our ksh is that if you specify a starting number that is too low, instead of printing just what it knows, it prints the following useful message (are you listening, ibm?): /bin/ksh: fc: 0403-009 The specified number is not valid for this command. thus, such a history alias would have to ensure that it doesn't try to print commands $HISTSIZE commands ago. --bw wohler@sap-ag.de