Re:Something about functions in Bash (2017)
by flukus on Thursday July 05, 2018 @11:12PM
(#17468589)
> Someone else will probably point out a better way. It is also only a couple of lines of Python.
grep -i "hello" filename # ;)
> I always can't help but notice the lack of expressivity. I mean it takes 1/2 page of code to read a text file and print all lines that say "hello"
I think you hit the nail on the head there. I've used just about every build system known to man and we're currently using cake at work, which is uses c# as a scripting language. Everything is 10 times more verbose than the equivalent shell/makefile would be. Things like concatenating sql files are 30 lines instead of code instead of one liners.
Re:Something about functions in Bash (2017)
by kccqzy on Thursday July 05, 2018 @11:28PM
(#17468645)
It's just
grep -i hello filename
Re:Something about functions in Bash (2017)
by 3rdAccount on Friday July 06, 2018 @11:22AM
(#17472146)
Haha, thanks! I always forget :)
cat filename | grep -i "hello"
Someone else will probably point out a better way. It is also only a couple of lines of Python.