Coder Social home page Coder Social logo

grep manual page about shell-genomics HOT 2 CLOSED

k8hertweck avatar k8hertweck commented on July 4, 2024 1
grep manual page

from shell-genomics.

Comments (2)

ErinBecker avatar ErinBecker commented on July 4, 2024

This sounds like a great idea. Unfortunately it doesn't work.

man cut | grep delimiter gives the output:

Use delim as the field delimiter character instead of the tab
delimiter character (see the -d option.) Output fields are sepa-
rated by a single occurrence of the field delimiter character.
-s Suppress lines with no field delimiter characters. Unless speci-
fied, lines with no delimiters are passed through unmodified.

Due to the way the man file is formatted, the word "delimiter" appears on the next line after the -d flag is introduced:

-d delim
   Use delim as the field delimiter character instead of the tab
   character.

This exercise works better if we use the / based search option within man cut, but that doesn't work as a good example of piping.

It also doesn't work if we use "delim" as the search term to grep (man cut | grep "delim"):

 terms of column position or in terms of fields delimited by a special
         Use delim as the field delimiter character instead of the tab
         delimiter character (see the -d option.)  Output fields are sepa-
         rated by a single occurrence of the field delimiter character.
 -s      Suppress lines with no field delimiter characters.  Unless speci-
         fied, lines with no delimiters are passed through unmodified.

This works: man cut | grep -B1 "delimiter" , but we're getting a little into the weeds here. . .

So in summary, I think it's a great idea, but it just doesn't play out well in practice. I favor not introducing this new exercise due to the complexity of execution and think it will be more confusing than helpful to learners. I'll leave it to the Maintainers to decide whether to close this issue or incorporate the exercise: @swang8 @smcclatchy @aschuerch

from shell-genomics.

swang8 avatar swang8 commented on July 4, 2024

The man cut output has some specific character, i.e., -^H-d^Hd ^Hd^He_^Hl_^Hi_^Hm, which makes the grep failed to detect the string "delimiter". It might be good not to use this exercise in the episode.

from shell-genomics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.