4 ms·
do you have any trouble running shell scripts? I would suppose that the #! line at the top of the script would save you from problems in most cases. What abou
by a_conservative 5y ago
do you have any trouble running shell scripts? I would suppose that the #! line at the top of the script would save you from problems in most cases.
What about bash one liners?
I had a bad experience with Ubuntu's (Debian's) dash shell many years ago and I've (lazily) just stuck with bash since then.
- ronjouch 5y agoNot OP, but happy fish user too. For me, yes I still write my scripts in hashbanged (ba)sh scripts; the only fish I write is my config.fish. Fish might be an objectively better language, I don't want to learn it and prefer keeping writing (ba)sh, as 1. (ba)sh is an evil I know... 2. ... that I must know anyway to work on servers (while fish's "utility" is low as used nowhere but around the fish shell)... 3. ... and shellcheck makes it (a bit) less of a footgun. When I do need to write a bash one-liner, I just run it in bash :) . But it's a once-in-a-blue-moon occurrence, since pipes are the same, and fish added syntax for && and || a few years ago (before that, they didn't exist and you had to use and; and or;), and added support a few months ago for `FOO=bar ...` direct env.var setting (before that you had to `env FOO bar ...`). So, your typical `thing --blah | grep stuff | awk stuff | whatever && something` generally works in fish.
- cuddlybacon 5y agoI use fish. My biggest pro-tip is don't chsh to set your shell to fish. Instead configure your terminal program to launch fish. * do you have any trouble running shell scripts? Nope. fish will run bash for most shebangs. * What about bash one liners? You will have to translate these.
- emilecantin 5y agoEasy: instead of "./the-script.sh", I run "bash the-script.sh". You can still type "bash" to get bash.