Stefan Monnier writes:
 > >>>>> "Pete" == Pete Forman <[EMAIL PROTECTED]> writes:
 > > Stefan Monnier writes:
 > >> Just guessing.  I refuse to believe that someone would write
 > >> a shell whose history file feature cannot be turned off.
 > > The POSIX/UNIX rules for shells mandate that history cannot be
 > > turned off, unless the shell is invoked non-interactively :-(
 > 
 > Can you point me to a precise quote (maybe in the SUSv2 spec) ?  I
 > can't really believe what you're telling me since the SUSv2 page
 > defining `sh'
 > (http://www.opengroup.org/onlinepubs/7908799/xcu/sh.html) presents
 > HISTFILE and HISTSIZE, both of which are directly relevant.
 > I.e. the user can set HISTSIZE to work around the poor Tramp
 > interaction (although as I said in another article, Tramp probably
 > shouldn't use here-documents, which would solve the main part of
 > the problem).  And Tramp could set HISTFILE to /dev/null so
 > clearly, there is a way to turn off the history file.  Maybe the
 > spec does not allow turning off the history feature, but that's not
 > relevant here.  We're only discussing the use of a history *file*.

Here is an excerpt from SUSv2 sh:

  HISTFILE
    Determine a pathname naming a command history file. If the
    HISTFILE variable is not set, the shell may attempt to access or
    create a file .sh_history in the user's home directory. If the
    shell cannot obtain both read and write access to, or create, the
    history file, it will use an unspecified mechanism that allows the
    history to operate properly. (References to history "file" in this
    section are understood to mean this unspecified mechanism in such
    cases.)

It is moot as to whether /dev/null is suitable for HISTFILE.  While it
does have read and write permissions I would infer that the shell
expects to be able to read back what is written.  A robust
implementation should be able to cope but can we rely on that?  Maybe
we could get away with trying "HISTFILE=/dev/null /bin/ksh" before
"/bin/ksh" in our search for a shell.


 >  set -o nolog
 >                   Prevent the entry of function definitions into
 >                   the command history. See Command History List.

That is only function definitions, not regular command line entries.
-- 
Pete Forman                 -./\.- Disclaimer: This post is originated
WesternGeco                   -./\.-  by myself and does not represent
[EMAIL PROTECTED]     -./\.-  opinion of Schlumberger, Baker
http://www.crosswinds.net/~petef  -./\.-  Hughes or their divisions.

Reply via email to