News for hackers. Stuff that matters.
Re:Use Haskell for shell scripting by Hz8NSD on Friday January 30, 2015 @05:30AM (#8971364)
I saw those as regular parser that returns text but not just grep wrapper. Yes It has function named 'grep', but its not grep wrapper. It looks like `lstree` could be combined with `grep` function for emulate `grep -r`.
Re:Use Haskell for shell scripting by mercurial on Friday January 30, 2015 @06:05AM (#8971461)
Take lstree then. How would you give it an option giving the kind of ordering you want?
Re:Use Haskell for shell scripting by barsoap on Friday January 30, 2015 @09:38AM (#8972175)
I guess you wouldn't, you'd have a sort function afterwards.

...for Unix' insistence on composability, the shell tools are often unnecessarily monolithic, probably because that's the only sane way if the only type you have in interconnect is `string`.

Re:Use Haskell for shell scripting by mercurial on Friday January 30, 2015 @11:09AM (#8972668)
Sure, but consider the common case of wanting the most recent file/directory in a directory. This would be something like "ls -t|head -n 1". It's pretty convenient, AND your ls function still returns only file and directory names, no additional information.

Here, you'd need to either parametrize the return type of ls to get simple strings (which is what you want most of time) or additional metadata, or alternatively to have different ls commands.