Live data from Hacker News

I wrote an bash enumerator because I was sick of xargs

numerlab.org

141–150 of 202 posts

Re: I wrote an bash enumerator because I was sick of xargs

#142
There's room for so much more innovation in the shell space. Microsoft did it with PowerShell - Linux seems to be stuck in the 1980s. You do have newer shells like fish, but they seem to only mess with the on-screen layout of the command prompt (while being stupid enough to still run within a terminal) and not the commands themselves.

I wonder if the generation one or two before mine grew up without shells and then had to make them and had no particular preconceptions, but my generation grew up treating the way shells work as a law of physics and thus doesn't innovate. Actually I wonder how much ossification is explained by this in general.

Re: I wrote an bash enumerator because I was sick of xargs

#143

In this thread: bash experts with arcane knowledge, unintentionally demonstrating how awful bash is. The obvious solution would be to use something more sane, like PowerShell or nushell, but instead old experts will always defend the skills they have honed for years, while criticizing anything that's different.

Bash is for whippersnappers, us old gits use POSIX sh

Re: I wrote an bash enumerator because I was sick of xargs

#144
post #118

I lol'd, but do you think this is valid? https://github.com/wallach-game/bashumerate/pull/1/files to me looks like a right solution, even if I was also tired of writing for loops by hand usually

The main reason to use xargs is to split up argument lists before they exceed the limit.

Re: I wrote an bash enumerator because I was sick of xargs

#145
My Summary of comments: Multiple commands in use can interpret a series of string values in weird ways.

You need to establish that every program's interpretation points to the same object before processing the object through the command chain. Stopping a bad command is more important than running the good ones.

There is no tool that does this one job.

Re: I wrote an bash enumerator because I was sick of xargs

#146

There's room for so much more innovation in the shell space. Microsoft did it with PowerShell - Linux seems to be stuck in the 1980s. You do have newer shells like fish, but they seem to only mess with the on-screen layout of the command prompt (while being stupid enough to still run within a terminal) and not the commands themselves. I wonder if the generation one or two before mine grew up without shells and then h…

Shells imo are legacy on legacy, I like bash and zsh, they’re nonsensical but they work. Powershell is undoubtedly saner, but I hate it.

I think the whole concept could be rewritten from the ground up to be modern, but reaching critical mass and mvp is too damn difficult, and the majority of mac/Linux users probably don’t want it.

Re: I wrote an bash enumerator because I was sick of xargs

#147

There's room for so much more innovation in the shell space. Microsoft did it with PowerShell - Linux seems to be stuck in the 1980s. You do have newer shells like fish, but they seem to only mess with the on-screen layout of the command prompt (while being stupid enough to still run within a terminal) and not the commands themselves. I wonder if the generation one or two before mine grew up without shells and then h…

Shells imo are legacy on legacy, I like bash and zsh, they’re nonsensical but they work. Powershell is undoubtedly saner, but I hate it. I think the whole concept could be rewritten from the ground up to be modern, but reaching critical mass and mvp is too damn difficult, and the majority of mac/Linux users probably don’t want it.

It's the opposite. Plan9's rc(1) it's much saner than Bash, Ksh and PowerShell.

Re: I wrote an bash enumerator because I was sick of xargs

#148
post #101

In this thread: bash experts with arcane knowledge, unintentionally demonstrating how awful bash is. The obvious solution would be to use something more sane, like PowerShell or nushell, but instead old experts will always defend the skills they have honed for years, while criticizing anything that's different.

I was the kind of shell guru whose teeth itched when they saw someone doing `grep | awk`. Then I had to try and bring Windows into a Mac+Linux CI system under Jenkins groovy files that were full of `"""sh` fragments, shell scriptlets wrapping python, etc, etc, and I don't bat ( I don't groovy either). Option 1: Learn to bat and try to translate. Hmm. No. Just no Option 2: ? Pwsh core had just come out. My immediate t…

awk can do grep by itself.

Re: I wrote an bash enumerator because I was sick of xargs

#149
post #67

> Or maybe you pipe into xargs and pray your filenames don’t have spaces… Always use -0. Most gnu utilities support it. It makes them put a null byte after every filename instead of a newline. Completely eliminates the problem of dealing with whitespace in the filenames.

To support your recommendation and redress the strawman the article postulates, the post's author could have replaced: find . -name '*.log' | xargs rm With: find . -name '*.log' -print0 | xargs -0 rm

This one doesn't need xargs.

  find . -name '*.log' -delete

Re: I wrote an bash enumerator because I was sick of xargs

#150
post #24

I have found that the most reliable way I like is to just construct the command externally and then pass to gnu parallel (mostly for --eta and --tmuxpane). And the great thing is, as others say, xargs -I. I prefer for shortness (and few collisoins), '@' seq 1 10|xargs -I@ echo 'bash run.py @'|parallel -j 10 I know the echo is a little silly but then I can remove the |parallel and see if it's right. And if I don't wan…

This is the way. Works very well.
Post reply on HN