4 ms·
I thought oil shell was the hot new thing. I really think it has the potential to displace both bash and zsh. My impression has always been that zsh is where
by curlypaul924 6y ago
I thought oil shell was the hot new thing. I really think it has the potential to displace both bash and zsh.
My impression has always been that zsh is where cool new features go first, and then bash plays catch up. I remember longing for associative arrays in bash while zsh and ksh already had them. What finally got me to move to zsh was colorized syntax; it makes some of my typos very obvious before I press Enter. In general zsh is still more pleasant for interactive use, but I still write scripts in bash since it is everywhere.
- michaelcampbell 6y agozsh's killer feature for me was "splat splat" and the extended shell globbing; `<splat><splat>/foo<splat>(.x)` type stuff. Replaced `find` for a lot of my interactive stuff, although I do use `find ... -print0 | xargs -0r ...` for a lot of things yet. I do realize `bash` also has `splat splat`, now. (curse HN's splat/star pseudo-markup)
- thiht 6y agoWhat's splat splat?
- ktpsns 6y agoAn asterisk character (star). Hackernews Wickes up this character.
- kaszanka 6y agoDoes escaping work? \\ It doesn't, that's interesting. *a*b*c*d* Looks like a code block is the only option.
- deleted 6y ago[deleted]
- oftenwrong 6y agoRecursive glob: ** You can enable it on recent versions of bash with: shopt -s globstar
- Symbiote 6y agoI write scripts which don't need to be portable using Zsh, and I find it very useful for interactive use too. If I'm handling a lot of files/file formats, the parameter expansion flags are very useful: for i in (#i)*.png~*orig*(oL); convert $i $i:r:l.jpg That's a (#i) case-insensitive match for ∗.png, but excluding ~ files matching ∗orig∗, and (oL) ordered by length/size. The $i:r strips the final file extension (i.e. .png), and the :l downcases the filename. x=( DSC_<0450-0630>.JPG ) some-command -A${^x} Runs: some-command -ADSC_0450.JPG -ADSC_0451.JPG -ADSC_0452.JPG … x is set to an array matching files like DSC_0500.JPG, where the number is in the range 0450-0630. The -A${^x} expands the array, prefixing each entry with -A. ls -l **/src/**/*(.x) Recursively list all plain files (.) that are executable (x), and where the directory "src" is somewhere in the path. Have a look at "man zshexpn" (then "Parameter Expansion") or [1], then "Filename Generation" further down. 30 minutes reading this is worthwhile for anyone who uses Zsh regularly. [1] http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parame...
- LukeShu 6y ago> I do realize `bash` also has `splat splat`, now. To put a date on that: Since Bash 4.0 in 2009. Which is ~forever since you tried zsh in 1993, but is also ~forever ago now. As for when zsh got it: It had "..../" in 2.0 (maybe before), that got changed to "<four splats>/" in 2.1.0 (1992?), and that got shortened to "<two splats>/" in 2.2.0 (1996?).
- deleted 6y ago[deleted]
- e12e 6y ago> I thought oil shell was the hot new thing. I'd say oilshell is the next thing, and fish is the hot new thing. I check in on oil from time to time, and I think it's headed in the right direction. Zsh is way too crazy for me - I'm quite happy with bash. But I sometimes spin up fish, and might be tempted over at some point.
- m-p-3 6y agoI never heard of oil shell, and to be fair the name really doesn't help with its discoverability since there's already a big oil company using that name.