this post was submitted on 16 Jul 2023
182 points (97.4% liked)

linuxmasterrace

2050 readers
1 users here now

A community for Linux enthusiasts.

May your htop stats be low and your beard grow long

Welcome to [email protected] former r/linuxmasterrace members and existing Lemmyverse citizens: Feel free to join the newly created [email protected] community.

Let’s make the full transition to the decentralized Fediverse!

founded 1 year ago
MODERATORS
 

I’m moving my posts from Reddit to Lemmy before delete them.

This post is from 2020-09-03.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 21 points 1 year ago (5 children)

Okay, you guys get the once in a liftetime chance to convince me that Bash is not the way to go. I'll eagerly await your proposals.

[–] gamma 6 points 1 year ago* (last edited 1 year ago) (1 children)

There are two massive points no one has mentioned yet.

  • Quoting every expansion isn't necessary in Zsh. Parameters don't split or glob by default.
  • $array actually expands to every element in an array.

Compare this between Bash and Zsh:

a=('/* hello */' 'world!' '  ')
printf '"%s" ' $a
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (1 children)

$array actually expands to every element in an array.

Very convenient. But ~every shell script is written in bash or POSIX(y) sh. When I need to write shell scripts I begin with busybox sh compability. If it turns out to be too complex, I'll convert to bash. This is because if I ever would publish the script it would have better changes to be accepted as a PR for example. Yes. Bash is a mess. I don't even like it that much. It's okay. But it's more standard then zsh. Although I've seen the tides turn on some occasions, like macOS.

Maybe some day I'll give zsh a second chance.

[–] gamma 2 points 1 year ago (1 children)

I used to write Bash more than anything, but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.

[–] [email protected] 1 points 1 year ago

but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.

Well said!

[–] muhyb 4 points 1 year ago

Bash is the way, zsh if you are lazy.

[–] [email protected] 1 points 1 year ago

This is me but for fish shell.

[–] [email protected] 1 points 1 year ago (1 children)

sh scripts can be run in even the dumbest distro out there, bash, not so much

[–] [email protected] 1 points 1 year ago

The debate was between zsh and bash, not necessarily POSIX sh.

[–] [email protected] 13 points 1 year ago (8 children)

Try fish with the tide plugin and the fzf plugin. I can never go back to anything else.

[–] [email protected] 2 points 1 year ago (1 children)

I love fish, only it annoys me, if I want to run a bash script.

[–] [email protected] 2 points 1 year ago (6 children)

Why is that? You can still use bash to interpret your bash scripts. Where does it annoy you?

load more comments (6 replies)
[–] muhyb 1 points 1 year ago

Haven't tried fish yet but fzf is a godsend.

load more comments (6 replies)
[–] [email protected] 7 points 1 year ago (4 children)

Which distro ships with zsh?

[–] muhyb 1 points 1 year ago

I believe it was Manjaro Bspwm which doesn't exist for quite some time.

[–] [email protected] 1 points 1 year ago
[–] [email protected] 1 points 1 year ago

Not a distro but macOS does ship zsh but default nowdays.

[–] [email protected] 4 points 1 year ago

i prefer fish

[–] [email protected] 2 points 1 year ago (1 children)

So what exactly is so great about it?

[–] muhyb 3 points 1 year ago

From my point of view, it's great because I'm lazy.

[–] [email protected] 1 points 1 year ago

I wish that oh-my-zsh could be installed at the host level rather than in ~/

[–] [email protected] 1 points 1 year ago (1 children)

What tool are u using for transferring your posts from reddit? Or is this done manual?

[–] muhyb 7 points 1 year ago

Automation can get you blocked from posting apparently, also I didn't have that many posts so I handpicked them.

load more comments
view more: next ›