• Text-Searching in "less"

    From R Daneel Olivaw@Danny@hyperspace.vogon.gov to alt.os.linux.suse on Tue Feb 11 09:44:48 2025
    From Newsgroup: alt.os.linux.suse

    From the "man" page:

    /pattern
    Search forward in the file for the N-th line containing the pattern. N defaults to 1.
    The pattern is a regular expression, as recognized by the regular expression library sup-
    plied by your system. By default, searching is case-sensitive (uppercase and lowercase
    are considered different); the -i option can be used to change this. The search starts
    at the first line displayed (but see the -a and -j options, which change this).


    I'm running Leap 15.6 (which is where that man page extract came from)
    and noticed that my searches are case-insensitive. Of course I do not
    have -i set but it is possible that OpenSUSE generously sets that option
    for me via an alias.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to alt.os.linux.suse on Tue Feb 11 13:41:55 2025
    From Newsgroup: alt.os.linux.suse

    On 2025-02-11 09:44, R Daneel Olivaw wrote:
    From the "man" page:

    /pattern
    -a-a-a-a-a-a-a-a-a-a-a-a-a Search forward in the file for the N-th line containing
    the pattern.-a N-a defaults-a to-a 1.
    -a-a-a-a-a-a-a-a-a-a-a-a-a The pattern is a regular expression, as recognized by
    the regular expression library sup-
    -a-a-a-a-a-a-a-a-a-a-a-a-a plied by your system.-a By default, searching is case-
    sensitive (uppercase-a and-a lowercase
    -a-a-a-a-a-a-a-a-a-a-a-a-a are-a considered-a different); the -i option can be used
    to change this.-a The search starts
    -a-a-a-a-a-a-a-a-a-a-a-a-a at the first line displayed (but see the -a and -j
    options, which change this).


    And where do you enter that 'N'?
    First time I read this.


    I'm running Leap 15.6 (which is where that man page extract came from)
    and noticed that my searches are case-insensitive.-a Of course I do not
    have -i set but it is possible that OpenSUSE generously sets that option
    for me via an alias.

    Searches have always been case insensitive inside less, for decades (in *suse). Since ever. It is the first time I see some one saying they are
    not (the manual).

    There are a lot of environment variables mentioned in the manual at the end.

    cer@Laicolasse:~> set | grep LESS
    LESS='-M -I -R'
    LESSCLOSE='lessclose.sh %s %s'
    LESSKEY=/etc/lesskey.bin
    LESSOPEN='lessopen.sh %s'
    LESS_ADVANCED_PREPROCESSOR=no
    cer@Laicolasse:~>

    There you have.

    -M or --LONG-PROMPT
    Causes less to prompt even more verbose-
    ly than more(1).

    -I or --IGNORE-CASE
    Like -i, but searches ignore case even
    if the pattern contains uppercase let-
    ters.

    -i or --ignore-case
    Causes searches to ignore case; that is,
    uppercase and lowercase are considered
    identical. This option is ignored if
    any uppercase letters appear in the
    search pattern; in other words, if a
    pattern contains uppercase letters, then
    that search does not ignore case.

    -R or --RAW-CONTROL-CHARS
    Like -r, but only ANSI "color" escape
    sequences and OSC 8 hyperlink sequences
    are output in "raw" form. Unlike -r,
    the screen appearance is maintained cor-
    rectly, provided that there are no es-
    cape sequences in the file other than
    these types of escape sequences. Color
    escape sequences are only supported when
    the color is changed within one line,
    not across lines. In other words, the
    beginning of each line is assumed to be
    normal (non-colored), regardless of any
    escape sequences in previous lines. For
    the purpose of keeping track of screen
    appearance, these escape sequences are
    assumed to not move the cursor.

    OSC 8 hyperlinks are sequences of the
    form:

    ESC ] 8 ; ... \7

    The terminating sequence may be either a
    BEL character (\7) or the two-character
    sequence "ESC \".

    ANSI color escape sequences are se-
    quences of the form:

    ESC [ ... m

    where the "..." is zero or more color
    specification characters. You can make
    less think that characters other than
    "m" can end ANSI color escape sequences
    by setting the environment variable
    LESSANSIENDCHARS to the list of charac-
    ters which can end a color escape se-
    quence. And you can make less think
    that characters other than the standard
    ones may appear between the ESC and the
    m by setting the environment variable
    LESSANSIMIDCHARS to the list of charac-
    ters which can appear.

    -r or --raw-control-chars
    Causes "raw" control characters to be
    displayed. The default is to display
    control characters using the caret nota-
    tion; for example, a control-A (octal
    001) is displayed as "^A" (with some ex-
    ceptions as described under the -U op-
    tion). Warning: when the -r option is
    used, less cannot keep track of the ac-
    tual appearance of the screen (since
    this depends on how the screen responds
    to each type of control character).
    Thus, various display problems may re-
    sult, such as long lines being split in
    the wrong place.

    USE OF THE -r OPTION IS NOT RECOMMENDED.
    --
    Cheers, Carlos.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From marrgol@marrgol@address.invalid to alt.os.linux.suse on Tue Feb 11 15:00:01 2025
    From Newsgroup: alt.os.linux.suse

    On 2025-02-11 at 13:41 Carlos E.R. wrote:
    -aFrom the "man" page:

    /pattern
    -a-a-a-a-a-a-a-a-a-a-a-a-a Search forward in the file for the N-th line containing the
    pattern.-a N-a defaults-a to-a 1.
    -a-a-a-a-a-a-a-a-a-a-a-a-a The pattern is a regular expression, as recognized by the
    regular expression library sup-
    -a-a-a-a-a-a-a-a-a-a-a-a-a plied by your system.-a By default, searching is case-
    sensitive (uppercase-a and-a lowercase
    -a-a-a-a-a-a-a-a-a-a-a-a-a are-a considered-a different); the -i option can be used to
    change this.-a The search starts
    -a-a-a-a-a-a-a-a-a-a-a-a-a at the first line displayed (but see the -a and -j options,
    which change this).


    And where do you enter that 'N'?
    First time I read this.

    From the top of the "man" page:

    DESCRIPTION
    [rCa] Commands may be preceded by a decimal number, called N in
    the descriptions below. The number is used by some commands,
    as indicated.


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to alt.os.linux.suse on Tue Feb 11 15:12:58 2025
    From Newsgroup: alt.os.linux.suse

    On 2025-02-11 15:00, marrgol wrote:
    On 2025-02-11 at 13:41 Carlos E.R. wrote:
    -aFrom the "man" page:

    /pattern
    -a-a-a-a-a-a-a-a-a-a-a-a-a Search forward in the file for the N-th line containing the
    pattern.-a N-a defaults-a to-a 1.
    -a-a-a-a-a-a-a-a-a-a-a-a-a The pattern is a regular expression, as recognized by the
    regular expression library sup-
    -a-a-a-a-a-a-a-a-a-a-a-a-a plied by your system.-a By default, searching is case-
    sensitive (uppercase-a and-a lowercase
    -a-a-a-a-a-a-a-a-a-a-a-a-a are-a considered-a different); the -i option can be used to
    change this.-a The search starts
    -a-a-a-a-a-a-a-a-a-a-a-a-a at the first line displayed (but see the -a and -j options,
    which change this).


    And where do you enter that 'N'?
    First time I read this.

    From the top of the "man" page:

    DESCRIPTION
    [rCa] Commands may be preceded by a decimal number, called N in
    the descriptions below. The number is used by some commands,
    as indicated.

    Ah, thanks :-)
    --
    Cheers, Carlos.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From R Daneel Olivaw@Danny@hyperspace.vogon.gov to alt.os.linux.suse on Wed Feb 12 18:33:07 2025
    From Newsgroup: alt.os.linux.suse

    Carlos E.R. wrote:
    On 2025-02-11 09:44, R Daneel Olivaw wrote:
    -aFrom the "man" page:

    /pattern
    -a-a-a-a-a-a-a-a-a-a-a-a-a Search forward in the file for the N-th line containing
    the pattern.-a N-a defaults-a to-a 1.
    -a-a-a-a-a-a-a-a-a-a-a-a-a The pattern is a regular expression, as recognized by
    the regular expression library sup-
    -a-a-a-a-a-a-a-a-a-a-a-a-a plied by your system.-a By default, searching is case-
    sensitive (uppercase-a and-a lowercase
    -a-a-a-a-a-a-a-a-a-a-a-a-a are-a considered-a different); the -i option can be used
    to change this.-a The search starts
    -a-a-a-a-a-a-a-a-a-a-a-a-a at the first line displayed (but see the -a and -j
    options, which change this).


    And where do you enter that 'N'?
    First time I read this.


    I'm running Leap 15.6 (which is where that man page extract came from)
    and noticed that my searches are case-insensitive.-a Of course I do not
    have -i set but it is possible that OpenSUSE generously sets that
    option for me via an alias.

    Searches have always been case insensitive inside less, for decades (in *suse). Since ever. It is the first time I see some one saying they are
    not (the manual).

    There are a lot of environment variables mentioned in the manual at the
    end.

    cer@Laicolasse:~> set | grep LESS
    LESS='-M -I -R'
    LESSCLOSE='lessclose.sh %s %s'
    LESSKEY=/etc/lesskey.bin
    LESSOPEN='lessopen.sh %s'
    LESS_ADVANCED_PREPROCESSOR=no
    cer@Laicolasse:~>

    There you have.

    -a-a-a-a-a-a -M or --LONG-PROMPT
    -a-a-a-a-a-a-a-a-a-a-a-a-a Causes less to prompt even more verbose-
    -a-a-a-a-a-a-a-a-a-a-a-a-a ly than more(1).

    -a-a-a-a-a-a -I or --IGNORE-CASE
    -a-a-a-a-a-a-a-a-a-a-a-a-a Like-a -i,-a but searches ignore case even
    -a-a-a-a-a-a-a-a-a-a-a-a-a if the pattern contains-a uppercase-a let-
    -a-a-a-a-a-a-a-a-a-a-a-a-a ters.

    -a-a-a-a-a-a -i or --ignore-case
    -a-a-a-a-a-a-a-a-a-a-a-a-a Causes searches to ignore case; that is,
    -a-a-a-a-a-a-a-a-a-a-a-a-a uppercase and lowercase-a are-a considered
    -a-a-a-a-a-a-a-a-a-a-a-a-a identical.-a-a This-a option-a is ignored if
    -a-a-a-a-a-a-a-a-a-a-a-a-a any-a uppercase-a letters-a appear-a in-a the
    -a-a-a-a-a-a-a-a-a-a-a-a-a search-a pattern;-a in-a other-a words, if a
    -a-a-a-a-a-a-a-a-a-a-a-a-a pattern contains uppercase letters, then
    -a-a-a-a-a-a-a-a-a-a-a-a-a that search does not ignore case.

    -a-a-a-a-a-a -R or --RAW-CONTROL-CHARS
    -a-a-a-a-a-a-a-a-a-a-a-a-a Like -r, but only-a ANSI-a "color"-a escape
    -a-a-a-a-a-a-a-a-a-a-a-a-a sequences-a and OSC 8 hyperlink sequences
    -a-a-a-a-a-a-a-a-a-a-a-a-a are output in "raw"-a form.-a-a Unlike-a -r,
    -a-a-a-a-a-a-a-a-a-a-a-a-a the screen appearance is maintained cor-
    -a-a-a-a-a-a-a-a-a-a-a-a-a rectly, provided that there are-a no-a es-
    -a-a-a-a-a-a-a-a-a-a-a-a-a cape-a sequences-a in-a the file other than
    -a-a-a-a-a-a-a-a-a-a-a-a-a these types of escape sequences.-a-a Color
    -a-a-a-a-a-a-a-a-a-a-a-a-a escape sequences are only supported when
    -a-a-a-a-a-a-a-a-a-a-a-a-a the color is changed-a within-a one-a line,
    -a-a-a-a-a-a-a-a-a-a-a-a-a not-a across-a lines.-a In other words, the
    -a-a-a-a-a-a-a-a-a-a-a-a-a beginning of each line is assumed to-a be
    -a-a-a-a-a-a-a-a-a-a-a-a-a normal-a (non-colored), regardless of any
    -a-a-a-a-a-a-a-a-a-a-a-a-a escape sequences in previous lines.-a For
    -a-a-a-a-a-a-a-a-a-a-a-a-a the-a purpose-a of keeping track of screen
    -a-a-a-a-a-a-a-a-a-a-a-a-a appearance, these escape-a sequences-a are
    -a-a-a-a-a-a-a-a-a-a-a-a-a assumed to not move the cursor.

    -a-a-a-a-a-a-a-a-a-a-a-a-a OSC-a 8-a hyperlinks-a are sequences of the
    -a-a-a-a-a-a-a-a-a-a-a-a-a form:

    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a ESC ] 8 ; ... \7

    -a-a-a-a-a-a-a-a-a-a-a-a-a The terminating sequence may be either a
    -a-a-a-a-a-a-a-a-a-a-a-a-a BEL-a character (\7) or the two-character
    -a-a-a-a-a-a-a-a-a-a-a-a-a sequence "ESC \".

    -a-a-a-a-a-a-a-a-a-a-a-a-a ANSI-a color-a escape-a sequences-a are-a se-
    -a-a-a-a-a-a-a-a-a-a-a-a-a quences of the form:

    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a ESC [ ... m

    -a-a-a-a-a-a-a-a-a-a-a-a-a where-a the-a "..."-a is zero or more color
    -a-a-a-a-a-a-a-a-a-a-a-a-a specification characters.-a You can-a make
    -a-a-a-a-a-a-a-a-a-a-a-a-a less-a think-a that-a characters other than
    -a-a-a-a-a-a-a-a-a-a-a-a-a "m" can end ANSI color escape-a sequences
    -a-a-a-a-a-a-a-a-a-a-a-a-a by-a-a setting-a the-a environment-a variable
    -a-a-a-a-a-a-a-a-a-a-a-a-a LESSANSIENDCHARS to the list of-a charac-
    -a-a-a-a-a-a-a-a-a-a-a-a-a ters-a which-a can-a end a color escape se-
    -a-a-a-a-a-a-a-a-a-a-a-a-a quence.-a And you-a can-a make-a less-a think
    -a-a-a-a-a-a-a-a-a-a-a-a-a that-a characters other than the standard
    -a-a-a-a-a-a-a-a-a-a-a-a-a ones may appear between the ESC and-a the
    -a-a-a-a-a-a-a-a-a-a-a-a-a m-a by-a setting-a the environment variable
    -a-a-a-a-a-a-a-a-a-a-a-a-a LESSANSIMIDCHARS to the list of-a charac-
    -a-a-a-a-a-a-a-a-a-a-a-a-a ters which can appear.

    -a-a-a-a-a-a -r or --raw-control-chars
    -a-a-a-a-a-a-a-a-a-a-a-a-a Causes-a "raw"-a control-a characters to be
    -a-a-a-a-a-a-a-a-a-a-a-a-a displayed.-a The default-a is-a to-a display
    -a-a-a-a-a-a-a-a-a-a-a-a-a control characters using the caret nota-
    -a-a-a-a-a-a-a-a-a-a-a-a-a tion; for example,-a a-a control-A-a (octal
    -a-a-a-a-a-a-a-a-a-a-a-a-a 001) is displayed as "^A" (with some ex-
    -a-a-a-a-a-a-a-a-a-a-a-a-a ceptions as described under the-a -U-a op-
    -a-a-a-a-a-a-a-a-a-a-a-a-a tion).-a-a Warning:-a when the -r option is
    -a-a-a-a-a-a-a-a-a-a-a-a-a used, less cannot keep track of the-a ac-
    -a-a-a-a-a-a-a-a-a-a-a-a-a tual-a appearance-a of-a the-a screen (since
    -a-a-a-a-a-a-a-a-a-a-a-a-a this depends on how the screen-a responds
    -a-a-a-a-a-a-a-a-a-a-a-a-a to-a each-a type-a of-a control-a character).
    -a-a-a-a-a-a-a-a-a-a-a-a-a Thus, various display problems-a may-a re-
    -a-a-a-a-a-a-a-a-a-a-a-a-a sult,-a such as long lines being split in
    -a-a-a-a-a-a-a-a-a-a-a-a-a the wrong place.

    -a-a-a-a-a-a-a-a-a-a-a-a-a USE OF THE -r OPTION IS NOT RECOMMENDED.




    SUSE (and openSUSE) appear to be outliers here, here is a complaint from
    2014: https://unix.stackexchange.com/questions/116395/less-searches-are-always-case-insensitive

    https://linuxhandbook.com/search-less-command/ and https://linuxopsys.com/less-command-cheat-sheet
    are clearly using other distributions and they claim things work the way
    "man less" documents them.

    You identified the
    LESS='-M -I -R'
    line and that is to be the problem. The other two options make perfect
    sense.
    I edited .profile, specifying
    export LESS="-M -R"
    and that changed the behaviour (after a reboot). Thank you.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to alt.os.linux.suse on Wed Feb 12 19:28:33 2025
    From Newsgroup: alt.os.linux.suse

    On 2025-02-12 18:33, R Daneel Olivaw wrote:
    Carlos E.R. wrote:
    On 2025-02-11 09:44, R Daneel Olivaw wrote:
    -aFrom the "man" page:

    ...

    SUSE (and openSUSE) appear to be outliers here, here is a complaint from 2014: https://unix.stackexchange.com/questions/116395/less-searches-are- always-case-insensitive

    Why did he not ask on the openSUSE mail list? He would have found the
    reason at least. I was there, too. Same as I found out how it was done I
    would have found 10 years ago.

    https://linuxhandbook.com/search-less-command/-a-a-a and https://linuxopsys.com/less-command-cheat-sheet
    are clearly using other distributions and they claim things work the way "man less" documents them.

    You identified the
    -a-a LESS='-M -I -R'
    line and that is to be the problem.-a The other two options make perfect sense.
    I edited .profile, specifying
    -a-a-a export LESS="-M -R"
    and that changed the behaviour (after a reboot).-a Thank you.


    You can ask in the mail list and reach the people that did this (unless
    they are no longer there or died or something). Or, directly create a
    bugzilla asking that the action be reversed.
    --
    Cheers, Carlos.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From mummycullen@mummycullen@gmail-dot-com.no-spam.invalid (MummyChunk) to alt.os.linux.suse on Wed Feb 12 22:40:41 2025
    From Newsgroup: alt.os.linux.suse

    Carlos E.R. wrote:
    On 2025-02-12 18:33, R Daneel Olivaw wrote:
    Carlos E.R. wrote:
    On 2025-02-11 09:44, R Daneel Olivaw wrote:
    From the "man" page:

    ....

    SUSE (and openSUSE) appear to be outliers here, here is a complaint from
    2014: https://unix.stackexchange.com/questions/116395/less-searches-are-
    always-case-insensitive

    Why did he not ask on the openSUSE mail list? He would have found the
    reason at least. I was there, too. Same as I found out how it was done I would have found 10 years ago.

    https://linuxhandbook.com/search-less-command/ and
    https://linuxopsys.com/less-command-cheat-sheet
    are clearly using other distributions and they claim things work the way
    "man less" documents them.

    You identified the
    LESS='-M -I -R'
    line and that is to be the problem. The other two options make perfect
    sense.
    I edited .profile, specifying
    export LESS="-M -R"
    and that changed the behaviour (after a reboot). Thank you.


    You can ask in the mail list and reach the people that did this (unless
    they are no longer there or died or something). Or, directly create a bugzilla asking that the action be reversed.

    --
    Cheers, Carlos.




    Where does one access the mail list?


    This is a response to the post seen at: http://www.jlaforums.com/viewtopic.php?p=683624946#683624946
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to alt.os.linux.suse on Thu Feb 13 00:37:42 2025
    From Newsgroup: alt.os.linux.suse

    On 2025-02-12 23:40, MummyChunk wrote:
    Carlos E.R. wrote:
    On 2025-02-12 18:33, R Daneel Olivaw wrote:
    Carlos E.R. wrote:
    On 2025-02-11 09:44, R Daneel Olivaw wrote:
    From the "man" page:

    You can ask in the mail list and reach the people that did this (unless
    they are no longer there or died or something). Or, directly create a
    bugzilla asking that the action be reversed.


    Where does one access the mail list?

    <https://lists.opensuse.org/archives/>

    The main one is "users@lists.opensuse.org"

    Instructions: <https://en.opensuse.org/openSUSE:Communication_channels>
    --
    Cheers, Carlos.
    --- Synchronet 3.21d-Linux NewsLink 1.2