Re: Midnight Commander /tmp race

From: Pavel Kankovsky (peakat_private)
Date: Wed Mar 18 1998 - 02:27:46 PST

  • Next message: Kusche, Klaus: "MS Word connected to DB/2: Cleartext host uid & pwd in document!"

    On Wed, 18 Mar 1998 willyat_private wrote:
    
    > > mc()
    > > {
    > >         MC=`/usr/bin/mc -P "$@"`
    > >         [ -n "$MC" ] && cd $MC
    > >         unset MC
    > > }
    >
    > Nope.  This (rather old) version breaks Ctrl-O for nonroot bash
    > instances.  However it works with Bourne shell.
    
    It is the "suspend key" (ctrl-z by default) but I get the point.
    
    bash 1.14.7, bash 2.00.0, and Solaris 2.5 ksh lock hard when the command
    in `` (or $()) is suspended.
    
    tcsh 6.06, Sol 2.5 csh, and Sol 2.5 jsh (sh + job control) disregard
    ctrl+z when processing the command in ``.
    
    Nevertheless, the function using a temporary file is not perfect either:
    it allows the user to suspend mc but when as the process is stopped
    the shell executes the rest of the function immediately (is it a bug or a
    feature?) and the desired effect is lost.
    
    
    --Pavel Kankovsky aka Peak   [ Boycott Microsoft -- http://www.vcnet.com/bms ]
    
    
    P.S. There are probably many dark cornerns in the job control:
    for instance, ``command1 && command2'' and ``command1 || command2''.
    
    What should happen when command1 is suspended?
    
    bash assumes command1 exits with code 0, csh seems to discard command2,
    jsh does not allow to suspend command1.
    



    This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 13:46:10 PDT