4 ms·
All the best to this project but since new cool shells keep coming up in the frontpage here, I am wondering if anybody is using an alternative shell as a daily
by yewenjie 5y ago
All the best to this project but since new cool shells keep coming up in the frontpage here, I am wondering if anybody is using an alternative shell as a daily driver and getting considerably more out of it?
- bobbylarrybobby 5y agoIs fish still considered alternative? The completions and suggestions still make it my go to. Thankfully it’s also started to bring its syntax inline with bash (e.g., by accepting `&&` in addition to `and;`)
- mst 5y agoI think that may be the paradox here. If it gets a significant userbase, it's much less clearly "alternative" anymore.
- ilaksh 5y agoI have also been using fish for years. But seeing how nice the scripting is that is built into Dune makes me want Dune features in fish. Or for Dune to get the autocomplete that fish has.
- yewenjie 5y agoI use fish and enjoy it, really cannot go back to zsh - feels too bloated. However, fish is not radically different from bash/ POSIX shell the way, lets say babashka [0] is. [0] https://github.com/babashka/babashka https://github.com/babashka/babashka
- HKH2 5y ago> Babashka is a tool you can use inside existing shells like bash and it is designed to play well with them. It does not aim to replace them.
- HKH2 5y agoI guess it depends on what you mean by 'considerably more'. I use Fish because you can quickly change options and view info in the config GUI, and I like its completions. I still script in Bash though.
- antongribok 5y agoI've been using Xonsh for the past 3 years. I really can't go back Bash. I write lots of small scripts and utilities for myself, perhaps on average one per week. Random stuff, like: slicing json data, renecoding home videos with ffmpeg, querying APIs with requests module, loops, dictionary comprehensions, etc... If some script needs to be deployed to production, it's fairly easy to rewrite it in plain Python. I've resisted installing it on our production systems, but I'm thinking more and more of using XXH for this instead.
- Aditya_Garg 5y agoIf you know python, then why bother with shell scripts in the first place?
- laumars 5y agoBecause if the main bulk of your problem is getting solved with external executables, like the ffmpeg example given, then it makes more sense to call them from a scripting language that is designed around forking other processes. Python be far more powerful than your average shell but it sucks for writing shell scripts.
- Joker_vD 5y agoThe thing is, bash kinda sucks at managing subprocesses the moment you start doing anything even slightly more interesting than "wait for the single launched subprocess/the last process in the pipe" (in fact, all UNIXes suck at it because of their fragile PID management but let's talk about the shell in particular). For example, imagine you want to run two processes in parallel and wait until both of them end; and you also want to be able to press Ctrl+C and interrupt them both. The cleanest way I could've find after much googling is ( trap 'kill 0' SIGINT worker A & worker B & wait ) It's a very delicate pattern because, for example, the use of subshell here is critical: without it SIGINT doesn't get delivered to the "worker" processes. One would think such a useful workflow ought to have a better built-in support but apparently not: people reinvent it all the time with $! and manual PID files and those things are very unreliable.
- deleted 5y ago[deleted]
- a1369209993 5y ago> if anybody is using an alternative shell as a daily driver and getting considerably more out of it? I wrote my own. Originally motivated by the fact that bash doesn't handle `$VARWITHSPACES` correctly (if I want expansion, I can write `$@VARWITHSPACES`), but I get a surprising amount of mileage out of random features shoved into corners of the substitution syntax like: $ factor $@m/[0-9]+/$[(1<<15)-((2*$0)-1)]/q'1 2 3' 32767: 7 31 151 32765: 5 6553 32763: 3 67 163 (`$q''` produces a string, `$@m/regex/pat/` finds matches in it and expands `"pat"` for each with $0,$1,... set to captures, and $[expr] evaluates match expressions.)
- a1369209993 5y ago> and $[expr] evaluates match expressions. Math. It evaluates math expressions. (I already had the logic handy since `${...}ARRAY` needs it to pick out a element of `$@ARRAY`.)
- hnlmorg 5y agoI've been using murex as my primary shell for years. Why do I use it? Because Bash (et al) syntax sucked for solving common modern day problems (like iterating through anything that isn't just a list of words, like the way variables are expanded in a dumb way (resulting in problems like spaces in file names breaking scripts), like how working with tables, json or other structured data requires inlining another language (aws, sed, jq, Perl, etc). and so on and so forth) So I created my own shell to fix these problems And while I was at it, I took influences from IDE to build out a better interactive terminal too. (I should probably write a blog post about some of the design decisions behind my shell)