why doesn't history work in a shell script?

Jonathan I. Kamens jik at athena.mit.edu
Thu Jun 7 08:00:08 AEST 1990


In article <1990Jun6.131927.22604 at cid.aes.doe.CA>,
afsipmh at cid.aes.doe.CA (Patrick Hertel) writes:
|> ["history" doesn't work in a csh shell script]

  There are various things that don't work in shell scripts, and the
history mechanism is one of them.  In fact, doing something like "!!" or
"!-1" won't work either.

  Another example are the "fg" and "bg" operations.  Try this script:

    #!/bin/csh
    sleep 60 &
    fg

and you'll probably get this error:

    No job control in this shell.

  I'm not sure what the solution to these problems is, either than using
another shell :-).

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list