lessecho missing? - SCO

This is a discussion on lessecho missing? - SCO ; Trying to "save" the less buffer using the "S" command results in: /bin/sh: lessecho: not found Reading the man page on less: LESSECHO4 Name of the lessecho program. The default is lessecho. The lessecho program is needed to expand metacharacters, ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: lessecho missing?

  1. lessecho missing?

    Trying to "save" the less buffer using the "S"
    command results in: /bin/sh: lessecho: not found

    Reading the man page on less:
    LESSECHO4
    Name of the lessecho program. The default is lessecho. The
    lessecho program is needed to expand metacharacters, such
    as * and ?, in filenames.

    Setting LESSECHO=/bin/ksh does not work:
    Results in "Input is not a pipe (press RETURN)"


    Creating /bin/lessecho as:

    $ cat /bin/lessecho
    cat -

    Does not work: Results in "Input is not a pipe (press RETURN)"

    Results are the same on SCO 5.0.7 and SCO 6.0


    What am I missing?

  2. Re: lessecho missing?

    On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > Trying to "save" the less buffer using the "S"
    > command results in: /bin/sh: lessecho: not found
    >
    > Reading the man page on less:
    > LESSECHO4
    > Name of the lessecho program. The default is lessecho. The
    > lessecho program is needed to expand metacharacters, such
    > as * and ?, in filenames.
    >
    > Setting LESSECHO=/bin/ksh does not work:
    > Results in "Input is not a pipe (press RETURN)"
    >
    > Creating /bin/lessecho as:
    >
    > $ cat /bin/lessecho
    > cat -
    >
    > Does not work: Results in "Input is not a pipe (press RETURN)"
    >
    > Results are the same on SCO 5.0.7 and SCO 6.0
    >
    > What am I missing?




    Hi Steve,

    A WAG-- any chance that "lesskey" is changing your environment?

    Try
    man lesskey
    and
    man F lesskey

    Good luck,
    Dan Martin


  3. Re: lessecho missing?

    Dan Martin wrote:
    >
    > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > Trying to "save" the less buffer using the "S"
    > > command results in: /bin/sh: lessecho: not found
    > >
    > > Reading the man page on less:
    > > LESSECHO4
    > > Name of the lessecho program. The default is lessecho. The
    > > lessecho program is needed to expand metacharacters, such
    > > as * and ?, in filenames.
    > >
    > > Setting LESSECHO=/bin/ksh does not work:
    > > Results in "Input is not a pipe (press RETURN)"
    > >
    > > Creating /bin/lessecho as:
    > >
    > > $ cat /bin/lessecho
    > > cat -
    > >
    > > Does not work: Results in "Input is not a pipe (press RETURN)"
    > >
    > > Results are the same on SCO 5.0.7 and SCO 6.0
    > >
    > > What am I missing?

    >
    > Hi Steve,
    >
    > A WAG-- any chance that "lesskey" is changing your environment?
    >
    > Try
    > man lesskey
    > and
    > man F lesskey
    >
    > Good luck,
    > Dan Martin


    Dan,

    Not a chance: Although the man pages for lesskey exist, there is no
    file on the system named lesskey to be executed.

    find / -name '*lesskey*' -print comes up blank.


    Does the (S)ave function in less work on your system?

    This is not a big problem when less is used in a pipeline to view text
    of unknown length: Once you see what you have pressing "S" to save the
    output to any file you name is handy. But if being run from the command
    prompt, I can re-run the command and replace the pipe to less with a
    redirect to a file.

    But I also use less as a pager for "output to screen" from a client's
    FoxBASE application. This works by setting up a "printer" that can
    be selected from the list of available printers:

    03/29/2007 Printer Maintenance 07:10:16

    +- Number Type ------------ Description -------------- System Value ----------+
    > | 0 0 Display cat | tee -a null | less |

    | 1 1 Okidata-Default lp -dprint1 -ob -s |
    | 2 7 HP Laser lp -dlaser -o6lpi -s |
    | 3 1 OKIDATA lp -dprint3 -ob -s

    So any report that allows the user to select the target printer can
    be displayed to the screen.

    Being able to save the less buffer to a file would allow a user to view
    a one-time process that normally would be sent to a printer, examine the
    results with less, then save the file to a /tmp/choose_your_favorite_temporary_name
    and then just lp the saved file from a command prompt to print it if desired.

    Note that the "tee -a null" in the faux printer setup handles the case should
    a user choose to abort the less pipeline without viewing the entire file.
    Without the tee, aborting less before all output is generated causes an
    error:

    > cat: output error (8940 characters written): Broken pipe (error 32)
    >
    > Unable to pipe to printer program.
    > @ X+1 , 0 SAY TN
    > ^
    > Called from - inven
    > Called from - mrpts
    > Cancel, Ignore, or Suspend? (C, I, or S)


    With the tee construct you still get an error about broken pipe but it does
    not cause the FoxBASE "unable to pipe to printer" error: tee: Warning -
    Error writing standard output; no further output: Broken pipe (error 32)



    I only point out the above to head off some helpful reader that will suggest:
    'Just change the "tee -a null" to "tee -a some_file" and you will automatically
    have your copy.' Null is a symlink in the current directory to /dev/null (too long to
    enter in the printer setup screen). And if two users are running reports
    in close succession, the last one overwrites the first, possibly before the first
    user deals with the saved file.

    So let's find an answer to the lessecho problem on SCO. Please.

  4. Re: lessecho missing?

    On Mar 29, 5:59 am, "Steve M. Fabac, Jr." wrote:
    > Dan Martin wrote:
    >
    > > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > > Trying to "save" the less buffer using the "S"
    > > > command results in: /bin/sh: lessecho: not found

    >
    > > > Reading the man page on less:
    > > > LESSECHO4
    > > > Name of the lessecho program. The default is lessecho. The
    > > > lessecho program is needed to expand metacharacters, such
    > > > as * and ?, in filenames.

    >
    > > > Setting LESSECHO=/bin/ksh does not work:
    > > > Results in "Input is not a pipe (press RETURN)"

    >
    > > > Creating /bin/lessecho as:

    >
    > > > $ cat /bin/lessecho
    > > > cat -

    >
    > > > Does not work: Results in "Input is not a pipe (press RETURN)"

    >
    > > > Results are the same on SCO 5.0.7 and SCO 6.0

    >
    > > > What am I missing?

    >
    > > Hi Steve,

    >
    > > A WAG-- any chance that "lesskey" is changing your environment?

    >
    > > Try
    > > man lesskey
    > > and
    > > man F lesskey

    >
    > > Good luck,
    > > Dan Martin

    >
    > Dan,
    >
    > Not a chance: Although the man pages for lesskey exist, there is no
    > file on the system named lesskey to be executed.
    >
    > find / -name '*lesskey*' -print comes up blank.
    >
    > Does the (S)ave function in less work on your system?
    >
    > This is not a big problem when less is used in a pipeline to view text
    > of unknown length: Once you see what you have pressing "S" to save the
    > output to any file you name is handy. But if being run from the command
    > prompt, I can re-run the command and replace the pipe to less with a
    > redirect to a file.
    >
    > But I also use less as a pager for "output to screen" from a client's
    > FoxBASE application. This works by setting up a "printer" that can
    > be selected from the list of available printers:
    >
    > 03/29/2007 Printer Maintenance 07:10:16
    >
    > +- Number Type ------------ Description -------------- System Value ----------+> | 0 0 Display cat | tee -a null | less |
    >
    > | 1 1 Okidata-Default lp -dprint1 -ob -s |
    > | 2 7 HP Laser lp -dlaser -o6lpi -s |
    > | 3 1 OKIDATA lp -dprint3 -ob -s
    >
    > So any report that allows the user to select the target printer can
    > be displayed to the screen.
    >
    > Being able to save the less buffer to a file would allow a user to view
    > a one-time process that normally would be sent to a printer, examine the
    > results with less, then save the file to a /tmp/choose_your_favorite_temporary_name
    > and then just lp the saved file from a command prompt to print it if desired.
    >
    > Note that the "tee -a null" in the faux printer setup handles the case should
    > a user choose to abort the less pipeline without viewing the entire file.
    > Without the tee, aborting less before all output is generated causes an
    > error:
    >
    > > cat: output error (8940 characters written): Broken pipe (error 32)

    >
    > > Unable to pipe to printer program.
    > > @ X+1 , 0 SAY TN
    > > ^
    > > Called from - inven
    > > Called from - mrpts
    > > Cancel, Ignore, or Suspend? (C, I, or S)

    >
    > With the tee construct you still get an error about broken pipe but it does
    > not cause the FoxBASE "unable to pipe to printer" error: tee: Warning -
    > Error writing standard output; no further output: Broken pipe (error 32)
    >
    >
    >
    > I only point out the above to head off some helpful reader that will suggest:
    > 'Just change the "tee -a null" to "tee -a some_file" and you will automatically
    > have your copy.' Null is a symlink in the current directory to /dev/null (too long to
    > enter in the printer setup screen). And if two users are running reports
    > in close succession, the last one overwrites the first, possibly before the first
    > user deals with the saved file.
    >
    > So let's find an answer to the lessecho problem on SCO. Please.



    Use /bin/pg or roll your own less. It's open source.


  5. Re: lessecho missing?

    ThreeStar typed (on Thu, Mar 29, 2007 at 09:50:00AM -0700):
    | > So let's find an answer to the lessecho problem on SCO. Please.
    |
    | Lesskey was on the 5.0.6 distribution; like you I don't see it in
    | 6.0. However, I got the same error on an attempted save in 5.0.6.

    I thought I posted a reply with a 6.0.0 binary of lessecho. Did no one
    see it?

    --
    JP
    ==> http://www.frappr.com/cusm <==

  6. Re: lessecho missing?

    Jean-Pierre Radley wrote (on Thu, Mar 29, 2007 at 01:52:02PM -0400):

    | ThreeStar typed (on Thu, Mar 29, 2007 at 09:50:00AM -0700):
    | | > So let's find an answer to the lessecho problem on SCO. Please.
    | |
    | | Lesskey was on the 5.0.6 distribution; like you I don't see it in
    | | 6.0. However, I got the same error on an attempted save in 5.0.6.
    |
    | I thought I posted a reply with a 6.0.0 binary of lessecho. Did no one
    | see it?

    I didn't see it.

    Bob

    --
    Bob Stockler +-+ bob@trebor.iglou.com +-+ http://members.iglou.com/trebor

  7. Re: lessecho missing?

    Steve M. Fabac, Jr. typed (on Wed, Mar 28, 2007 at 04:54:55PM +0000):
    | Trying to "save" the less buffer using the "S"
    | command results in: /bin/sh: lessecho: not found
    |
    | Reading the man page on less:
    | LESSECHO4
    | Name of the lessecho program. The default is lessecho. The
    | lessecho program is needed to expand metacharacters, such
    | as * and ?, in filenames.
    |
    | Setting LESSECHO=/bin/ksh does not work:
    | Results in "Input is not a pipe (press RETURN)"
    |
    |
    | Creating /bin/lessecho as:
    |
    | $ cat /bin/lessecho
    | cat -
    |
    | Does not work: Results in "Input is not a pipe (press RETURN)"
    |
    | Results are the same on SCO 5.0.7 and SCO 6.0
    |
    |
    | What am I missing?

    Any environmental variables needing to be exported, that are not?
    # set | grep -y less
    LESS=-ceij4z-4
    LESSOPEN='|lesspipe %s'

    - Jeff H

  8. Re: lessecho missing?

    Jean-Pierre Radley wrote:
    > ThreeStar typed (on Thu, Mar 29, 2007 at 09:50:00AM -0700):
    > | > So let's find an answer to the lessecho problem on SCO. Please.
    > |
    > | Lesskey was on the 5.0.6 distribution; like you I don't see it in
    > | 6.0. However, I got the same error on an attempted save in 5.0.6.
    >
    > I thought I posted a reply with a 6.0.0 binary of lessecho. Did no one
    > see it?
    >

    JP, Wierde results: Your follow up post:

    > Attached are my binaries of less, lessecho and lesskey for OSR
    > 6.0.0. They are based on version 394 of the soure code (while OSR
    > 6.0.0's /bin/less is from version 374).
    >
    > I've also attached my lesspipe script. which allows less to show you
    > xxx.Z, yyy.gz, or zzz.bz2 if you've got LESSOPEN set to '|lesspipe %s'
    > in your environment.
    >
    > FWIW, the first new beta release in a long time, less 401, just got
    > released.


    Was delivered via e-mail to my mail box but when I checked c.u.s.m NG
    directly, it is missing.

    I tried the files on my 5.0.7 system with MP5 and got the following results:

    # ./less <- your binary
    dynamic linker: ./less: relocation error: symbol not found: _runtime_env;
    referenced from: /usr/lib/libgnuintl.so.4

    Killed

    # ldd less
    less needs:
    /usr/lib/libgnuintl.so.4
    /usr/lib/libc.so.1 => /udk/usr/lib/libc.so.1

    # find / -name 'libgnu*' -print
    /usr/lib/libgnuintl.so.4
    /usr/lib/libgnuintl.so
    /usr/lib/libgnuintl.so.7
    /usr/lib/libgnuintl.la
    /usr/include/libgnuintl.h
    /usr/gnu/lib/libgnuintl.so
    /opt/K/SCO/gwxlibs/2.1.0Ce/usr/include/libgnuintl.h
    /opt/K/SCO/gwxlibs/2.1.0Ce/usr/lib/libgnuintl.la
    /opt/K/SCO/gwxlibs/2.1.0Ce/usr/lib/libgnuintl.so.4

    So libgnuint1.so.4 on 5.0.7 is incomplete due to the missing _runtime_env.

    I wonder if I can copy libgnuint1.so.4 from a 6.0 system and use it on the
    5.0.7 system?

    lessecho (copied to /usr/bin) executed by itself does not throw an error.
    But the SCO less binary still belches: Input is not a pipe (press RETURN)


  9. Re: lessecho missing?

    Jeff Hyman wrote:
    > Steve M. Fabac, Jr. typed (on Wed, Mar 28, 2007 at 04:54:55PM +0000):
    > | Trying to "save" the less buffer using the "S"
    > | command results in: /bin/sh: lessecho: not found
    > |
    > | Reading the man page on less:
    > | LESSECHO4
    > | Name of the lessecho program. The default is lessecho. The
    > | lessecho program is needed to expand metacharacters, such
    > | as * and ?, in filenames.
    > |
    > | Setting LESSECHO=/bin/ksh does not work:
    > | Results in "Input is not a pipe (press RETURN)"
    > |
    > |
    > | Creating /bin/lessecho as:
    > |
    > | $ cat /bin/lessecho
    > | cat -
    > |
    > | Does not work: Results in "Input is not a pipe (press RETURN)"
    > |
    > | Results are the same on SCO 5.0.7 and SCO 6.0
    > |
    > |
    > | What am I missing?
    >
    > Any environmental variables needing to be exported, that are not?
    > # set | grep -y less
    > LESS=-ceij4z-4
    > LESSOPEN='|lesspipe %s'
    >
    > - Jeff H


    On my 5.0.7 system:

    $ set | grep -y less
    LESS='--chop-long-lines --shift 8'

    What is the function of LESSOPEN above?

  10. Re: lessecho missing?

    Steve M. Fabac, Jr. wrote:

    > > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > > Trying to "save" the less buffer using the "S"
    > > > command results in: /bin/sh: lessecho: not found
    > > >
    > > > Reading the man page on less:
    > > > LESSECHO4
    > > > Name of the lessecho program. The default is lessecho. The
    > > > lessecho program is needed to expand metacharacters, such
    > > > as * and ?, in filenames.


    > > > Results are the same on SCO 5.0.7 and SCO 6.0
    > > >
    > > > What am I missing?


    Well, `lessecho` for one...

    This OSR506 system has /usr/bin/lessecho, a 4KB binary symlinked from
    /opt/K/SCO/Unix/5.0.6Ga/usr/bin/lessecho. So one choice would be to
    copy it from a 506 system.

    Another is to just plain ignore it. I ran:

    cat /etc/termcap | LESSECHO=/abc/def less

    and hit 's', "/tmp/junk". This produced the message:

    /bin/ksh: line 1: /abc/def: not found

    -- and a fine copy of /etc/termcap in /tmp/junk. So `less` whines about
    the missing binary, then does its stuff successfully.

    Or you can roll your own. I created /tmp/lameecho with these contents:

    #!/bin/sh
    while [ $# -gt 0 ]; do
    case $1 in
    -*) shift;;
    *) echo "$@"; exit 0;;
    esac
    done

    This strips off any leading "-whatever" options, then echos the rest.
    For my simple test case ('s /tmp/junk'), less was invoking lessecho as:

    lessecho -p0x22 -d0x22 -- /tmp/junk

    so `lameecho` outputs just "/tmp/junk", which is the desired effect.

    `lessecho` apparently comes into play when you use the ":e" command from
    inside `less`. It uses it to quote filenames that have spaces in them
    (why it needs to do that is a mystery to me since it apparently handles
    the wildcard expansion itself...) Anyway, this means that my `lameecho`
    version won't work if you say ":e foo*" and a file named "foo bar"
    matches. But you'll live.

    Install either OSR506 /usr/bin/lessecho or the above `lameecho` as
    /usr/bin/lessecho on your system; done.

    >Bela<


  11. Re: lessecho missing?

    Bela Lubkin wrote:
    >
    > Steve M. Fabac, Jr. wrote:
    >
    > > > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > > > Trying to "save" the less buffer using the "S"
    > > > > command results in: /bin/sh: lessecho: not found
    > > > >
    > > > > Reading the man page on less:
    > > > > LESSECHO4
    > > > > Name of the lessecho program. The default is lessecho. The
    > > > > lessecho program is needed to expand metacharacters, such
    > > > > as * and ?, in filenames.

    >
    > > > > Results are the same on SCO 5.0.7 and SCO 6.0
    > > > >
    > > > > What am I missing?

    >
    > Well, `lessecho` for one...
    >
    > This OSR506 system has /usr/bin/lessecho, a 4KB binary symlinked from
    > /opt/K/SCO/Unix/5.0.6Ga/usr/bin/lessecho. So one choice would be to
    > copy it from a 506 system.
    >
    > Another is to just plain ignore it. I ran:
    >
    > cat /etc/termcap | LESSECHO=/abc/def less
    >
    > and hit 's', "/tmp/junk". This produced the message:
    >
    > /bin/ksh: line 1: /abc/def: not found
    >
    > -- and a fine copy of /etc/termcap in /tmp/junk. So `less` whines about
    > the missing binary, then does its stuff successfully.


    Bela,

    The construct: "cat /etc/termcap | LESSECHO=/abc/def less" worked on my
    5.0.7 system just as you described.

    However, coping lessecho from 5.0.6 and placing it in /usr/bin does not:

    # what /usr/bin/lessecho
    /usr/bin/lessecho:
    lessecho SCO OpenServer 5.0.6a 2001-02-19


    # less /etc/termcap
    ....
    # SCO Termcap File
    #
    #@################################################ ##############################
    #
    # Naming Convention:
    # - First entry is two chars, first char indicates manufacturer,
    # second char represents canonical abbreviation for model or mode.
    # - Second entry is canonical abbreviation.
    # - Third entry is the one the editor will print with "set" command.
    # - Last entry is a verbose description of the terminal.
    # - Other entries are mnemonic synonyms for the terminal.
    #
    log file: /tmp/badtest

    After enter key:
    # SCO Termcap File
    #
    #@################################################ ##############################
    #
    # Naming Convention:
    # - First entry is two chars, first char indicates manufacturer,
    # second char represents canonical abbreviation for model or mode.
    # - Second entry is canonical abbreviation.
    # - Third entry is the one the editor will print with "set" command.
    # - Last entry is a verbose description of the terminal.
    # - Other entries are mnemonic synonyms for the terminal.
    #
    Input is not a pipe (press RETURN)

    And: # set | grep -y less
    LESS='--chop-long-lines --shift 8'
    LESSECHO=/usr/bin/lessecho
    #

    Then trying your lameecho:
    # ls -l lessecho
    -rwxr-xr-x 1 root sys 107 Mar 30 09:47 lessecho
    # cat lessecho
    #!/bin/sh
    while [ $# -gt 0 ]; do
    case $1 in
    -*) shift;;
    *) echo "$@"; exit 0;;
    esac
    done
    #

    I get the same results:
    # - Other entries are mnemonic synonyms for the terminal.
    #
    Input is not a pipe (press RETURN)


    So something else is still not correct. The construct "| LESSECHO=/abc/def less"
    in the less command line works, but is too long to fit in a faux printer
    definition in most applications where I use less to effect output of printed
    reports to the screen:

    03/29/2007 Printer Maintenance 07:10:16

    +- Number Type ------------ Description -------------- System Value ----------+
    > | 0 0 Display cat | tee -a null | less |

    | 1 1 Okidata-Default lp -dprint1 -ob -s |
    | 2 7 HP Laser lp -dlaser -o6lpi -s |
    | 3 1 OKIDATA lp -dprint3 -ob -s


    >
    > Or you can roll your own. I created /tmp/lameecho with these contents:
    >
    > #!/bin/sh
    > while [ $# -gt 0 ]; do
    > case $1 in
    > -*) shift;;
    > *) echo "$@"; exit 0;;
    > esac
    > done
    >
    > This strips off any leading "-whatever" options, then echos the rest.
    > For my simple test case ('s /tmp/junk'), less was invoking lessecho as:
    >
    > lessecho -p0x22 -d0x22 -- /tmp/junk
    >
    > so `lameecho` outputs just "/tmp/junk", which is the desired effect.
    >
    > `lessecho` apparently comes into play when you use the ":e" command from
    > inside `less`. It uses it to quote filenames that have spaces in them
    > (why it needs to do that is a mystery to me since it apparently handles
    > the wildcard expansion itself...) Anyway, this means that my `lameecho`
    > version won't work if you say ":e foo*" and a file named "foo bar"
    > matches. But you'll live.


    I don't understand the :e usage. :e brings up "Examine:" to read a file?
    Never used that before.

    Trying :e with or without lessecho on my system successfully reads in the
    "examined" file.

    >
    > Install either OSR506 /usr/bin/lessecho or the above `lameecho` as
    > /usr/bin/lessecho on your system; done.
    >
    > >Bela<

    --

    Steve Fabac
    S.M. Fabac & Associates
    816/765-1670

  12. Re: lessecho missing?

    Steve M. Fabac, Jr. typed (on Fri, Mar 30, 2007 at 03:55:35AM +0000):
    | Jeff Hyman wrote:
    | >
    | >Any environmental variables needing to be exported, that are not?
    | ># set | grep -y less
    | >LESS=-ceij4z-4
    | >LESSOPEN='|lesspipe %s'
    | >
    | >- Jeff H
    |
    | On my 5.0.7 system:
    |
    | $ set | grep -y less
    | LESS='--chop-long-lines --shift 8'
    |
    | What is the function of LESSOPEN above?

    Invokes a pre-filtering script, which I happen to call 'lesspipe', which
    enables less to show you a compressed file. (the man page's description
    is more better :-)

    #!/bin/sh
    #@(#) lesspipe; JPRadley; 17Nov99 v 1.0; 29Mar07 v 1.1
    #@(#) invoked by 'less' when the env.var. LESSOPEN='|lesspipe %s'

    case "$1" in
    *.gz|*.tgz|*.Z) zcat $1 2>/dev/null ;;
    *.bz2) bzcat $1 2>/dev/null ;;
    esac

    --
    JP
    ==> http://www.frappr.com/cusm <==

  13. Re: lessecho missing?

    In article <20070330165030.GA16421@jpradley.jpr.com>,
    Jean-Pierre Radley wrote:
    >Steve M. Fabac, Jr. typed (on Fri, Mar 30, 2007 at 03:55:35AM +0000):
    >| Jeff Hyman wrote:
    >| >
    >| >Any environmental variables needing to be exported, that are not?
    >| ># set | grep -y less
    >| >LESS=-ceij4z-4
    >| >LESSOPEN='|lesspipe %s'
    >| >
    >| >- Jeff H
    >|
    >| On my 5.0.7 system:
    >|
    >| $ set | grep -y less
    >| LESS='--chop-long-lines --shift 8'
    >|
    >| What is the function of LESSOPEN above?
    >
    >Invokes a pre-filtering script, which I happen to call 'lesspipe', which
    >enables less to show you a compressed file. (the man page's description
    >is more better :-)
    >
    >#!/bin/sh
    >#@(#) lesspipe; JPRadley; 17Nov99 v 1.0; 29Mar07 v 1.1
    >#@(#) invoked by 'less' when the env.var. LESSOPEN='|lesspipe %s'
    >
    >case "$1" in
    > *.gz|*.tgz|*.Z) zcat $1 2>/dev/null ;;
    > *.bz2) bzcat $1 2>/dev/null ;;
    >esac
    >
    >--
    >JP
    > ==> http://www.frappr.com/cusm <==


    And there is a program called 'most' which automatically
    uncompresses the file and displays it, and if you run 'most' on
    a binary file - it shows it in the typical three column
    format of hexaddress: hex-display ascii-translation.

    --------from the description page---------
    most is a pager (like less) that displays, one windowful at a time,
    the contents of a file on a terminal. It pauses after each windowful
    and prints the following on the window status line: the screen, the
    file name, current line number, and the percentage of the file so far
    displayed.

    In addition to displaying ordinary text files, most can also display
    binary files as well as files with arbitrary ascii characters. As an
    option, autosensing of binary files can be disabled (via the -k
    option), thereby allowing one to browse files encoded in a different
    language (Japanese, Korean, Chinese, etc).

    WWW: http://www.jedsoft.org/most/
    FTP: ftp://ftp.jedsoft.org/pub/davis/most

    --------------------

    Bill

    --
    Bill Vermillion - bv @ wjv . com

  14. Re: lessecho missing?

    Steve M. Fabac, Jr. wrote:

    > Bela Lubkin wrote:
    > >
    > > Steve M. Fabac, Jr. wrote:
    > >
    > > > > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > > > > Trying to "save" the less buffer using the "S"
    > > > > > command results in: /bin/sh: lessecho: not found
    > > > > >
    > > > > > Reading the man page on less:
    > > > > > LESSECHO4
    > > > > > Name of the lessecho program. The default is lessecho. The
    > > > > > lessecho program is needed to expand metacharacters, such
    > > > > > as * and ?, in filenames.

    > >
    > > > > > Results are the same on SCO 5.0.7 and SCO 6.0
    > > > > >
    > > > > > What am I missing?

    > >
    > > Well, `lessecho` for one...
    > >
    > > This OSR506 system has /usr/bin/lessecho, a 4KB binary symlinked from
    > > /opt/K/SCO/Unix/5.0.6Ga/usr/bin/lessecho. So one choice would be to
    > > copy it from a 506 system.
    > >
    > > Another is to just plain ignore it. I ran:
    > >
    > > cat /etc/termcap | LESSECHO=/abc/def less
    > >
    > > and hit 's', "/tmp/junk". This produced the message:
    > >
    > > /bin/ksh: line 1: /abc/def: not found
    > >
    > > -- and a fine copy of /etc/termcap in /tmp/junk. So `less` whines about
    > > the missing binary, then does its stuff successfully.

    >
    > Bela,
    >
    > The construct: "cat /etc/termcap | LESSECHO=/abc/def less" worked on my
    > 5.0.7 system just as you described.
    >
    > However, coping lessecho from 5.0.6 and placing it in /usr/bin does not:
    >
    > # what /usr/bin/lessecho
    > /usr/bin/lessecho:
    > lessecho SCO OpenServer 5.0.6a 2001-02-19
    >
    >
    > # less /etc/termcap
    > ...
    > # SCO Termcap File
    > #
    > #@################################################ ##############################
    > #
    > # Naming Convention:
    > # - First entry is two chars, first char indicates manufacturer,
    > # second char represents canonical abbreviation for model or mode.
    > # - Second entry is canonical abbreviation.
    > # - Third entry is the one the editor will print with "set" command.
    > # - Last entry is a verbose description of the terminal.
    > # - Other entries are mnemonic synonyms for the terminal.
    > #
    > log file: /tmp/badtest
    >
    > After enter key:
    > # SCO Termcap File
    > #
    > #@################################################ ##############################
    > #
    > # Naming Convention:
    > # - First entry is two chars, first char indicates manufacturer,
    > # second char represents canonical abbreviation for model or mode.
    > # - Second entry is canonical abbreviation.
    > # - Third entry is the one the editor will print with "set" command.
    > # - Last entry is a verbose description of the terminal.
    > # - Other entries are mnemonic synonyms for the terminal.
    > #
    > Input is not a pipe (press RETURN)


    Only guessing, but that looks like maybe your shell is picking up a
    per-shell startup file (like .kshrc or .cshrc -- not the per-login file
    ..profile or .login) that has some command in it that fails in this
    environment. Try moving aside your .[ck]shrc temporarily, see if that
    error goes away; if so, move it back and comment out portions to figure
    out which part causes it.

    > So something else is still not correct. The construct "| LESSECHO=/abc/def less"
    > in the less command line works, but is too long to fit in a faux printer
    > definition in most applications where I use less to effect output of printed
    > reports to the screen:


    The construct:

    FOO=bar some-command

    is a shorthand for running some-command with FOO=bar added to its
    environment. You can get the same results by exporting
    LESSECHO=/abc/def in your .profile or system-wide, whatever you feel
    like. Then whenever you (or you app) runs `less` it will already have
    that in its environment.

    So, ironically, it looks like the solution for you is to set $LESSECHO to
    an invalid command name, because less's error handling for that case is
    more advantageous to you than whatever's going on in the case where it
    actually runs the command it's trying to run...

    > > `lessecho` apparently comes into play when you use the ":e" command from
    > > inside `less`. It uses it to quote filenames that have spaces in them
    > > (why it needs to do that is a mystery to me since it apparently handles
    > > the wildcard expansion itself...) Anyway, this means that my `lameecho`
    > > version won't work if you say ":e foo*" and a file named "foo bar"
    > > matches. But you'll live.

    >
    > I don't understand the :e usage. :e brings up "Examine:" to read a file?
    > Never used that before.
    >
    > Trying :e with or without lessecho on my system successfully reads in the
    > "examined" file.


    ":e some files and wild*cards" is just like running `less some files and
    wild*cards`, without having to exit the first instance of `less`. If
    you have some files with spaces in their names, and invoke them by
    wildcard, you can see the effects of not having a working $LESSECHO. Or
    at least you could if whatever it is wasn't making $LESSECHO totally fail
    for you. This would be a scenario where you would notice the
    difference:

    $ echo foo > foo
    $ echo goo > "foo bar"
    $ less /etc/termcap
    ...
    :e foo*

    At that point you ought to be looking at files "foo" and "foo bar"; but
    without a working $LESSECHO, it will instead try to look at files "foo",
    "foo" and "bar".

    `less` uses $LESSECHO whenever you give it a filename in a ":" command,
    which brings us back to the original ":s logfile" that started your
    question. I guess it wants to make sure it does the right thing if you
    type ":s foo bar". Instead it creates a big hassle and a long thread on
    USENET...

    >Bela<


  15. Re: lessecho missing?

    Bela Lubkin wrote:
    >
    > Steve M. Fabac, Jr. wrote:
    >
    > > Bela Lubkin wrote:
    > > >
    > > > Steve M. Fabac, Jr. wrote:
    > > >
    > > > > > On Mar 28, 12:54 pm, "Steve M. Fabac, Jr." wrote:
    > > > > > > Trying to "save" the less buffer using the "S"
    > > > > > > command results in: /bin/sh: lessecho: not found
    > > > > > >
    > > > > > > Reading the man page on less:
    > > > > > > LESSECHO4
    > > > > > > Name of the lessecho program. The default is lessecho. The
    > > > > > > lessecho program is needed to expand metacharacters, such
    > > > > > > as * and ?, in filenames.
    > > >
    > > > > > > Results are the same on SCO 5.0.7 and SCO 6.0
    > > > > > >
    > > > > > > What am I missing?
    > > >
    > > > Well, `lessecho` for one...
    > > >
    > > > This OSR506 system has /usr/bin/lessecho, a 4KB binary symlinked from
    > > > /opt/K/SCO/Unix/5.0.6Ga/usr/bin/lessecho. So one choice would be to
    > > > copy it from a 506 system.
    > > >
    > > > Another is to just plain ignore it. I ran:
    > > >
    > > > cat /etc/termcap | LESSECHO=/abc/def less
    > > >
    > > > and hit 's', "/tmp/junk". This produced the message:
    > > >
    > > > /bin/ksh: line 1: /abc/def: not found
    > > >
    > > > -- and a fine copy of /etc/termcap in /tmp/junk. So `less` whines about
    > > > the missing binary, then does its stuff successfully.

    > >
    > > Bela,
    > >
    > > The construct: "cat /etc/termcap | LESSECHO=/abc/def less" worked on my
    > > 5.0.7 system just as you described.


    Bela,

    Maybe not. I went back and revisited the problem and the message "Input is
    not a pipe (press RETURN)" only occurs when I type "less /etc/termcap" and
    then try the (S)ave command to save a copy to a designated file. Less
    rightly is saying: "Why should I make a copy when you can copy the file
    you are viewing without my help."

    Cat /etc/termcap | less then responds to (S)ave by saving a copy of its buffer
    to the file designated. This happens with or without the construct
    "cat /etc/termcap | lessecho=/abc/def less"

    Now originally, before I had any version of lessecho, less would complain
    "/bin/sh: lessecho: not found"

    Now, even after I remove the lessecho from 5.0.6 (renamed to lessecho5.0.6)
    and /usr/bin looks like:

    $ ls -l /usr/bin/*less*
    lrwxrwxrwx 1 root sys 36 Dec 4 23:46 /usr/bin/less -> /opt/K/SC
    O/Unix/5.0.7Hw/usr/bin/more
    -rwx--x--x 1 bin bin 4096 Jul 1 2003 /usr/bin/lessecho5.0.6
    -rwxr-xr-x 1 root sys 217 Mar 29 22:58 /usr/bin/lesspipe.jpr
    $

    cat /etc/termcap | less and use the (S)ave comamnd now does this:

    # - Third entry is the one the editor will print with "set" command.
    # - Last entry is a verbose description of the terminal.
    # - Other entries are mnemonic synonyms for the terminal.
    #
    log file: /tmp/checkoutless

    $ pwd
    /u/smf
    $ ls -lt | head
    total 509542
    >-rw-r--r-- 1 smf group 134327 Apr 1 22:03 kd=EB:kh=EH:kl=ED:kr=EC:

    drwxr-xr-x 4 smf group 512 Mar 31 23:03 mailfolders
    drwxrwxrwx 3 smf sys 1024 Mar 31 11:20 Mail
    drwxrwxrwx 10 smf group 2048 Mar 21 16:30 smokenfire

    Where /etc/termcap is dumped into the current directory and named with the value of
    some segment in the /etc/termcap file.

    Tring it again with /etc/ptest:
    cat /etc/ptest | less

    21 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    22 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    23 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    24 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    log file: /tmp/checkit3

    Results in the following in the current directory:

    -rw-r--r-- 1 smf group 43520 Apr 1 22:08 106 1 2 3 4 5 6 7 8
    -rw-r--r-- 1 smf group 134327 Apr 1 22:03 kd=EB:kh=EH:kl=ED:kr=EC:
    drwxr-xr-x 4 smf group 512 Mar 31 23:03 mailfolders
    drwxrwxrwx 3 smf sys 1024 Mar 31 11:20 Mail
    drwxrwxrwx 10 smf group 2048 Mar 21 16:30 gallas

    $ sum -r /etc/ptest /etc/termcap *106* *:*
    00195 117 /etc/ptest
    18862 85 106 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8
    930 1 2 3 4 5

    14373 295 /etc/termcap
    12497 263 kd=EB:kh=EH:kl=ED:kr=EC:

    So the files are not the same. And nothing appears in /tmp:

    ls -lt /tmp | head -5
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****
    -rw-r--r-- 1 smf group 59904 Mar 31 23:14 badbobdog
    -rw-r--r-- 1 smf group 2735 Mar 31 23:12 sec2bad
    -rw-r--r-- 1 smf group 2674 Mar 31 23:12 secbad

    Putting lessecho5.0.6 back as lessecho and trying the above again:

    cat /etc/termcap | less

    # - Last entry is a verbose description of the terminal.
    # - Other entries are mnemonic synonyms for the terminal.
    #
    log file: /tmp/testwlessecho
    Warning: "kd=EB:kh=EH:kl=ED:kr=EC:" exists; Overwrite, Append or Don't log?

    $ ls -lt | head -5
    total 509630
    -rw-r--r-- 1 smf group 134327 Apr 1 22:26 kd=EB:kh=EH:kl=ED:kr=EC:
    -rw-r--r-- 1 smf group 43520 Apr 1 22:08 106 1 2 3 4 5 6 7 8
    910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    drwxr-xr-x 4 smf group 512 Mar 31 23:03 mailfolders
    drwxrwxrwx 3 smf sys 1024 Mar 31 11:20 Mail

    And Nothing appears in /tmp:

    $ ls -lt /tmp | head -5
    total 278478
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****
    -rw-r--r-- 1 smf group 59904 Mar 31 23:14 badbobdog
    -rw-r--r-- 1 smf group 2735 Mar 31 23:12 sec2bad

    $ LESSECHO=/usr/bin/lessecho
    $ export LESSECHO
    $ cat /etc/termcap | less
    # - Last entry is a verbose description of the terminal.
    # - Other entries are mnemonic synonyms for the terminal.
    #
    log file: /tmp/afterexportlessecho

    # - Other entries are mnemonic synonyms for the terminal.
    #
    Invalid option letterxportlessecho
    :

    And:

    $ ls -lt /tmp | head -5
    total 278776
    -rw-r--r-- 1 smf group 150711 Apr 1 22:31 afterexportlessecho
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****
    -rw-r--r-- 1 smf group 59904 Mar 31 23:14 badbobdog

    $ sum -r /etc/termcap /tmp/after*
    14373 295 /etc/termcap
    14373 295 /tmp/afterexportlessecho

    $pwd
    /u/smf
    $ ls -lt | head -5
    total 509630
    -rw-r--r-- 1 smf group 134327 Apr 1 22:26 kd=EB:kh=EH:kl=ED:kr=EC:
    -rw-r--r-- 1 smf group 43520 Apr 1 22:08 106 1 2 3 4 5 6 7 8
    910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    drwxr-xr-x 4 smf group 512 Mar 31 23:03 mailfolders
    drwxrwxrwx 3 smf sys 1024 Mar 31 11:20 Mail




    > >
    > > However, coping lessecho from 5.0.6 and placing it in /usr/bin does not:
    > >
    > > # what /usr/bin/lessecho
    > > /usr/bin/lessecho:
    > > lessecho SCO OpenServer 5.0.6a 2001-02-19
    > >
    > >
    > > # less /etc/termcap
    > > ...
    > > # SCO Termcap File
    > > #
    > > #@################################################ ##############################
    > > #
    > > # Naming Convention:
    > > # - First entry is two chars, first char indicates manufacturer,
    > > # second char represents canonical abbreviation for model or mode.
    > > # - Second entry is canonical abbreviation.
    > > # - Third entry is the one the editor will print with "set" command.
    > > # - Last entry is a verbose description of the terminal.
    > > # - Other entries are mnemonic synonyms for the terminal.
    > > #
    > > log file: /tmp/badtest
    > >
    > > After enter key:
    > > # SCO Termcap File
    > > #
    > > #@################################################ ##############################
    > > #
    > > # Naming Convention:
    > > # - First entry is two chars, first char indicates manufacturer,
    > > # second char represents canonical abbreviation for model or mode.
    > > # - Second entry is canonical abbreviation.
    > > # - Third entry is the one the editor will print with "set" command.
    > > # - Last entry is a verbose description of the terminal.
    > > # - Other entries are mnemonic synonyms for the terminal.
    > > #
    > > Input is not a pipe (press RETURN)

    >
    > Only guessing, but that looks like maybe your shell is picking up a
    > per-shell startup file (like .kshrc or .cshrc -- not the per-login file
    > .profile or .login) that has some command in it that fails in this
    > environment. Try moving aside your .[ck]shrc temporarily, see if that
    > error goes away; if so, move it back and comment out portions to figure
    > out which part causes it.


    I tried moving .profile out of the way and running on the profile settings
    set by /etc/profile only whith the result:

    you have mail
    $ env
    HOME=/u/smf
    HUSHLOGIN=FALSE
    HZ=100
    LOGNAME=smf
    MAIL=/usr/spool/mail/smf
    PATH=/bin:/usr/bin:/usr/gnu/bin:/sbin:/usr/local/bin
    SHELL=/bin/sh
    TERM=ansi
    TZ=CST6CDT5,M3.2.0/2:00:00,M11.1.0/2:00:00
    you have mail
    $ env
    HOME=/u/smf
    HUSHLOGIN=FALSE
    HZ=100
    LOGNAME=smf
    MAIL=/usr/spool/mail/smf
    PATH=/bin:/usr/bin:/usr/gnu/bin:/sbin:/usr/local/bin
    SHELL=/bin/sh
    TERM=ansi
    TZ=CST6CDT5,M3.2.0/2:00:00,M11.1.0/2:00:00

    23 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    24 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    log file: /tmp/nodotprofile
    Warning: " 106 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2
    3 4 5 " exists; Overwrite, Append or Don't log?
    $ ls -lt | head -5
    total 509630
    -rw-r--r-- 1 smf group 43520 Apr 1 22:40 106 1 2 3 4 5 6 7 8
    910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    -rw-r--r-- 1 smf group 134327 Apr 1 22:26 kd=EB:kh=EH:kl=ED:kr=EC:
    drwxr-xr-x 4 smf group 512 Mar 31 23:03 mailfolders
    drwxrwxrwx 3 smf sys 1024 Mar 31 11:20 Mail

    $ ls -lt /tmp | head -5
    total 278776
    -rw-r--r-- 1 smf group 150711 Apr 1 22:31 afterexportlessecho
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****
    -rw-r--r-- 1 smf group 59904 Mar 31 23:14 badbobdog

    ls -la | less
    drwx------ 49 smf group 6144 Apr 1 22:38 .
    drwxr-xr-x 7 smf sys 512 Mar 23 21:23 ..
    -rw-r--r-- 1 smf group 59 Mar 7 09:49 .desked_pref
    drwxr-xr-x 7 smf group 512 Jun 22 2005 .edge
    -rwx--x--- 1 smf group 122 Sep 15 2006 .fetchmailrc
    -rw-r--r-- 1 smf sys 19 Aug 23 2006 .forward
    drwx------ 2 smf group 512 Nov 27 10:33 .gnupg
    -r-------- 1 smf auth 0 Apr 1 22:38 .lastlogin
    -rw-r--r-- 1 smf sys 85 Aug 23 2006 .old_procmailrc
    -rw-r--r-- 1 smf sys 1295 Dec 28 11:08 .procmailrc
    -rw------- 1 smf group 1691 Nov 7 11:10 .profile.out
    -rw------- 1 smf group 0 Oct 5 2003 .prwarn_time
    -r-------- 1 smf group 24 Aug 13 2004 .rhosts
    -rw------- 1 smf sys 80 May 25 2006 .scoadmin.pref
    -rw------- 1 smf group 4908 Apr 1 22:38 .sh_history
    -rw-rw-rw- 1 smf group 188 Dec 17 2002 .signiture
    drwx------ 2 smf group 512 Apr 1 22:30 .spamassassin
    drwx------ 2 smf group 512 Mar 22 14:24 .ssh
    -rw-r--r-- 1 smf group 5 Mar 28 23:42 .ssh_printer
    -rw-r--r-- 1 smf group 826 Sep 20 2006 .utillist2
    -rw-rw-rw- 1 smf group 166 Aug 16 2004 .wp51.set

    # cd /u
    # mv smf smf.out
    # mkdir smf
    # chown smf:group smf
    # ls -ld smf*
    drwxr-xr-x 2 smf group 512 Apr 1 22:44 smf
    drwx------ 49 smf group 6144 Apr 1 22:38 smf.out

    you have mail
    $ ls -la
    total 4
    drwxr-xr-x 2 smf group 512 Apr 1 22:45 .
    drwxr-xr-x 8 smf sys 512 Apr 1 22:44 ..
    -r-------- 1 smf auth 0 Apr 1 22:45 .lastlogin

    23 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    24 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    log file: /tmp/emptyhomedir.text

    $ ls -la
    total 92
    -rw-r--r-- 1 smf group 43520 Apr 1 22:48 106 1 2 3 4 5 6 7 8
    910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    drwxr-xr-x 2 smf group 512 Apr 1 22:48 .
    drwxr-xr-x 8 smf sys 512 Apr 1 22:48 ..
    -r-------- 1 smf auth 0 Apr 1 22:45 .lastlogin

    $ ls -lt /tmp | head -5
    total 278776
    -rw-r--r-- 1 smf group 150711 Apr 1 22:31 afterexportlessecho
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****
    -rw-r--r-- 1 smf group 59904 Mar 31 23:14 badbobdog


    $ cat /etc/ptest | LESSECHO=/usr/bin/lessecho less
    23 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    24 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    log file: /tmp/emptyhomedir_with_LESSECHO=_construct
    23 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    24 1 2 3 4 5 6 7 8 910 1 2 3 4 5 6 7 8 920 1 2 3 4 5 6 7 8 930 1 2 3 4 5
    Invalid option letteromedir_with_LESSECHO=_construct
    :

    $ ls -lt /tmp | head -5
    total 278896
    -rw-r--r-- 1 smf group 59904 Apr 1 22:56 emptyhomedir_with_LESSECHO
    =_construct
    -rw-r--r-- 1 smf group 150711 Apr 1 22:31 afterexportlessecho
    -r--r----- 1 smf mail 5 Apr 1 21:49 151265.298
    -rw-r--r-- 1 smf group 4415 Apr 1 00:09 jack****


    From the above, it is obvious that less as provided by SCO on 5.0.7 with
    MP5 has strange problems.

    I'm on vacation next week, and vacation for me includes not checking the
    NG. So I'll pick this backup up when I return on 4/9.



    >
    > > So something else is still not correct. The construct "| LESSECHO=/abc/def less"
    > > in the less command line works, but is too long to fit in a faux printer
    > > definition in most applications where I use less to effect output of printed
    > > reports to the screen:

    >
    > The construct:
    >
    > FOO=bar some-command
    >
    > is a shorthand for running some-command with FOO=bar added to its
    > environment. You can get the same results by exporting
    > LESSECHO=/abc/def in your .profile or system-wide, whatever you feel
    > like. Then whenever you (or you app) runs `less` it will already have
    > that in its environment.
    >
    > So, ironically, it looks like the solution for you is to set $LESSECHO to
    > an invalid command name, because less's error handling for that case is
    > more advantageous to you than whatever's going on in the case where it
    > actually runs the command it's trying to run...
    >
    > > > `lessecho` apparently comes into play when you use the ":e" command from
    > > > inside `less`. It uses it to quote filenames that have spaces in them
    > > > (why it needs to do that is a mystery to me since it apparently handles
    > > > the wildcard expansion itself...) Anyway, this means that my `lameecho`
    > > > version won't work if you say ":e foo*" and a file named "foo bar"
    > > > matches. But you'll live.

    > >
    > > I don't understand the :e usage. :e brings up "Examine:" to read a file?
    > > Never used that before.
    > >
    > > Trying :e with or without lessecho on my system successfully reads in the
    > > "examined" file.

    >
    > ":e some files and wild*cards" is just like running `less some files and
    > wild*cards`, without having to exit the first instance of `less`. If
    > you have some files with spaces in their names, and invoke them by
    > wildcard, you can see the effects of not having a working $LESSECHO. Or
    > at least you could if whatever it is wasn't making $LESSECHO totally fail
    > for you. This would be a scenario where you would notice the
    > difference:
    >
    > $ echo foo > foo
    > $ echo goo > "foo bar"
    > $ less /etc/termcap
    > ...
    > :e foo*
    >
    > At that point you ought to be looking at files "foo" and "foo bar"; but
    > without a working $LESSECHO, it will instead try to look at files "foo",
    > "foo" and "bar".
    >
    > `less` uses $LESSECHO whenever you give it a filename in a ":" command,
    > which brings us back to the original ":s logfile" that started your
    > question. I guess it wants to make sure it does the right thing if you
    > type ":s foo bar". Instead it creates a big hassle and a long thread on
    > USENET...
    >
    > >Bela<



    --

    Steve Fabac
    S.M. Fabac & Associates
    816/765-1670

+ Reply to Thread