SóProvas


ID
2096746
Banca
CESPE / CEBRASPE
Órgão
TCE-PA
Ano
2016
Provas
Disciplina
Sistemas Operacionais
Assuntos

Julgue o item a seguir acerca do emprego da ferramenta shell no desenvolvimento de scripts.

A principal ferramenta do Unix utilizada para a realização de buscas no conteúdo dos arquivos é o grep, cujas variantes são grep, egrep e fgrep.

Alternativas
Comentários
  • egrep is 100% equivalent to grep -E

    fgrep is 100% equivalent to grep -F

    Historically these switches were provided in separate binaries. On some really old Unix systems you will find that you need to call the separate binaries, but on all modern systems the switches are preferred. The man page for grep has details about this.

     

    As for what they do, -E switches grep into a special mode so that the expression is evaluated as an ERE (Extended Regular Expression) as opposed to its normal pattern matching. Details of this syntax are on the man page.

    -E, --extended-regexp
    Interpret PATTERN as an extended regular expression

     

    The -F switch switches grep into a different mode where it accepts a pattern to match, but then splits that pattern up into one search string per line and does an OR search on any of the strings without doing any special pattern matching.

    -F, --fixed-strings
    Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched.

     

    http://unix.stackexchange.com/questions/17949/what-is-the-difference-between-grep-egrep-and-fgrep

     

    Gabarito: Certo

  • tem ainda o pgrep

    pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout

  • Seguindo o manual(man) do grep, temos: In addition, two variant programs egrep and fgrep are available. egrep is the same as grep -E. fgrep is the same as grep -F. Direct invocation as either egrep or fgrep is deprecated, but is provided to allow historical applications that rely on them to run unmodified. Gabarito, Certo. FFF
  • grep, fgrep , egrep

    Procura em um ou mais arquivos por linhas que contêm um padrão de busca (expressão regular simples ou estendida)

     

     

    Certo

     

     

    Fonte: Linux - Guia do Administrador do Sistema - 2ed Rubem E. Ferreira

  • CERTO

    GREP: PROCURA UM FICHEIRO POR UM  PADRÃO, SENDO UM FILTRO MUITO USADO E ÚTIL.

  • Orra! A galera gastando o inglês nos comentários