by jonnycomputer · 3y ago · 0 comments
e.g.
I need to grab some info from textfile.txt to use as arguments to a function.
cat textfile.txt
looks like its comma delimited.
cat textfile.txt | cut -d, -f 2-5
ah, its the third and fourth column i need
cat textfile.txt | cut -d, -f 3-4 | grep '123456'
perfect
cat textfile.txt | cut -d, -f 3-4 | grep 123456 | tr , ' '
myfunc $(cat textfile.txt | cut -d, -f 3-4 | grep 123456 | tr , ' ')
> looks like its comma delimited.
Interesting; why wouldn't you use `head`? Who knows how big textfile.txt is?
lot's of times we sort of know what we are working with, but don't remember the particulars especially
I still uselessly use cat though, it's such a nice way to build a pipeline.
I've been typing cat for over 25 years. Old habits die hard.