• Почему grep не умеет групировать?

    @mcleod095
    Для начала можно было бы хоть бы в man залезть и посмотреть
    GREP(1) GREP(1)

    NAME
    grep, egrep, fgrep - print lines matching a pattern

    SYNOPSIS
    grep [options] PATTERN [FILE...]
    grep [options] [-e PATTERN | -f FILE] [FILE...]

    DESCRIPTION
    Grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PAT-
    TERN. By default, grep prints the matching lines.

    In addition, two variant programs egrep and fgrep are available. Egrep is the same as grep -E. Fgrep is the same as grep -F.

    Здесь написано что он работает со строками, я думаю этим все сказано
    Ну и если уж не нравится делать длинные конвейеры то изучите awk
    ifconfig | awk '/inet/{gsub(/.*:/,"",$2);print $2}'
    Ответ написан
    Комментировать