RHEL 8, se for importante.
Preciso encontrar todas as linhas em um arquivo de texto que correspondem a estes três filtros:
cut -f1 -d: .pgpass | grep ^FISP | grep -E 'CDS|TAP' | grep PGS401
FISPCDSPGS401A
FISPCDSPGS401B
FISPTAPPGS401AA
FISPTAPPGS401AB
FISPTAPPGS401BA
FISPTAPPGS401BB
FISPTAPPGS401CA
FISPTAPPGS401CB
FISPTAPPGS401DA
FISPTAPPGS401DB
Isso, semelhante ao globbing estendido do bash, é o tipo de comando que estou procurando, mas não corresponde.
cut -f1 -d: .pgpass | grep '^FISP@(CDS|TAP)PGS401'
cut -f1 -d: .pgpass | grep -E '^FISP@(CDS|TAP)PGS401'
Qual é o segredo?
EDIT1: todos os dados
$ cut -f1 -d: .pgpass | grep -v '^$'
FISPCDSPGS202a
FISPCDSPGS202a
FISPCDSPGS202c
FISPCDSPGS202b
FISPCDSPGS202b
FISPCDSPGS202c
FISPCDSPGS202
FISPCCPGS302a
FISPCCPGS302b
FISPCCPGS302a
FISPCCPGS302b
FISPCCPGS302c
FISPCCPGS302
FISPCDSPGS302a
FISPCDSPGS302b
FISPCDSPGS302a
FISPCDSPGS302b
FISPCDSPGS302c
FISPCDSPGS302
FISPTAPPGS302a
FISPTAPPGS302b
FISPTAPPGS302a
FISPTAPPGS302b
FISPTAPPGS302c
FISPTAPPGS302
FISPCCPGS405a
FISPCCPGS405b
FISPCCPGS405a
FISPCCPGS405b
FISPCCPGS405c
FISPCCPGS405
FISPCDSPGS405a
FISPCDSPGS405b
FISPCDSPGS405a
FISPCDSPGS405b
FISPCDSPGS405c
FISPCDSPGS405
FISPTAPPGS405a
FISPTAPPGS405b
FISPTAPPGS405a
FISPTAPPGS405b
FISPTAPPGS405c
FISPTAPPGS405
FISPCDSPGS202c
FISPCCPGS302c
FISPCDSPGS302c
FISPTAPPGS302c
FISPCCPGS405c
FISPCDSPGS405c
FISPTAPPGS405c
FISSLBXPGS202a
FISSLBXPGS202b
FISSLBXPGS302a
FISSLBXPGS302b
FISSLBXPGS405a
FISSLBXPGS405b
FISPCDSPGS401A
FISPCDSPGS401B
FISPTAPPGS401AA
FISPTAPPGS401AB
FISPTAPPGS401BA
FISPTAPPGS401BB
FISPTAPPGS401CA
FISPTAPPGS401CB
FISPTAPPGS401DA
FISPTAPPGS401DB
FISQCCPGS401A
FISQCCPGS401B
FISQCCPGS401A
FISQCCPGS401B
FISQCCPGS401C
FISQCCPGS401
FISQCDSPGS401A
FISQCDSPGS401B
FISQCDSPGS401A
FISQCDSPGS401B
FISQCDSPGS401C
FISQCDSPGS401
FISQTAPPGS401A
FISQTAPPGS401B
FISQTAPPGS401A
FISQTAPPGS401B
FISQTAPPGS401C
FISQTAPPGS401
EDIT1: "ponto e asterisco" parece não funcionar.
$ cut -f1 -d: .pgpass | grep '^FISP.*(CDS|TAP).*PGS401'
$