Hacker News new | ask | show | jobs
by shirogane86x 1023 days ago
Along the lines of what another user said, you can actually get this a lot shorter. given variables $haystack and $needle, this actually becomes

    $haystack | lines | where $it =~ $needle 
which, albeit maybe not as concise as the grep solution, to me feels good enough, especially when you have so many other tools to handle text (all of the str subcommands, splitting by row/column and then working on tables). also, admittedly, if you want to drop down to "normal" ls, you are one character away: use a caret and you can drop down to the usual bash/sh/whatever.