4 ms·
Often times I’ll want to grab just one part of a command’s output to use for the input of another command. Sometimes I can use grep to do this, and sometimes gr
by judgej2 15y ago
Often times I’ll want to grab just one part of a command’s output to use for the input of another command. Sometimes I can use grep to do this, and sometimes grep isn’t quite flexible enough and sed is required. The regular expression required to get sed to do the right thing is often complex on its own, and of course the flags need to be set appropriately. If the data format is in columns, sometimes cut can be simpler.
Master Foo nodded and replied: "When you are hungry, eat; when you are thirsty, drink; when you are tired, sleep."
Upon hearing this, the novice was enlightened.
-- http://catb.org/~esr/writings/unix-koans/shell-tools.html http://catb.org/~esr/writings/unix-koans/shell-tools.html
- mindslight 15y agoDon't koans generally cast off preexisting notions? It seems the philosophy espoused by that story is "don't think too much about the design of your tools".
- msbarnett 15y agoI read it as "there are many ways you could solve a problem; rather than obsess over which is The One True Way in All Situations, choose whichever is the simplest path to scratching your itch".