News for hackers. Stuff that matters.
Re:Bash 5.0 released by chrisshroba on Monday January 07, 2019 @11:20PM (#18853117)
It seems like this would eliminate the need to read a file from disk and fork a new process, both of which take time. If you're just removing a single file, this is probably negligible, but if you have a script iterating over 10k files, i.e., this speed-up may be more welcome.
Re:Bash 5.0 released by viraptor on Tuesday January 08, 2019 @12:05AM (#18853316)
> if you have a script iterating over 10k files

That's probably a good sign you should advance from shell. If the script is trivial, it's going to be trivial in python / ruby / go / crystal / ... as well. If it's not trivial, that's another reason to move.

Re:Bash 5.0 released by adrianN on Tuesday January 08, 2019 @12:41AM (#18853499)
I agree that as scripts get more complex, you should migrate from bash. But the number of files a script touches says almost nothing about its complexity.
Re:Bash 5.0 released by viraptor on Tuesday January 08, 2019 @03:20AM (#18854128)
Wasn't saying otherwise. One reason is complexity. Another is performance.
Re:Bash 5.0 released by pwg on Tuesday January 08, 2019 @06:40AM (#18854853)
True, but if you are iterating over 10k files and removing them, then a find|xargs pipe with xargs feeding rm the maximum number of parameters the kernel allows per fork will likely be faster than a bash interpreter loop, even with a bash builtin rm.
Re:Bash 5.0 released by e12e on Tuesday January 08, 2019 @02:19PM (#18858613)
You think find|xargs would be faster than (gnu) find -delete?
Re:Bash 5.0 released by pwg on Tuesday January 08, 2019 @04:31PM (#18859902)
No, my comment was "will likely be faster than a bash interpreter loop". The key phrase is "bash interpreter loop".

I was not comparing find|xargs to find -delete.