Skip to content

/usr/local/bin/highlight-mint stumbles over a slash #151

@michaeltosch1256-ops

Description

@michaeltosch1256-ops

I typed
apt search /packagekit
and got an error sed: -e Ausdruck #1, Zeichen 12: Unbekannte Option für »s« (German locale).
I should have got nothing, simply because it didn't match anything.
The culprit is
/usr/local/bin/highlight-mint
that uses sed with / delimiters. So the / in my search string caused the error.

I think that grep does the job better. Uses BRE as well, but no delimiter. And can even handle the highlighting: the customizable grep colors apply.
My proposal is

#!/bin/sh
unset GREP_OPTIONS
grep --color=auto -- "$1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions