[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Why do people still use Bash when Zsh is vastly superior and
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 156
Thread images: 17
File: flat,800x800,075,f.jpg (23 KB, 800x400) Image search: [Google]
flat,800x800,075,f.jpg
23 KB, 800x400
Why do people still use Bash when Zsh is vastly superior and a drop-in replacement?
>>
bloat
>>
>>53755437
Why is it better?
>>
>>53755446
342kB of main binary is bloat now?
>>
>>53755460
- better autocompletion
- better prompts
- shared histories
- globbing
- spelling correction
...
>>
>>53755560
>...
Calm down little man, I was only asking a question.
I literally didn't know what the advantages of Zsh were.

Is it easy to configure?
>>
>>53755560
>bullshit
>bullshit
>bullshit
>bullshit
>bullshit
...
>>
Most peo0le who use linux dont even know that bash exists op let alone that they can change it
>>
>>53755597
>>
>>53755560
If it stops me from having to press tab twice I'm sold
>>
>>53755638
>open image
>trnsparent and most of the text disappears against the black background of hte phone
>>
File: 8nLFCVP.png (51 KB, 657x527) Image search: [Google]
8nLFCVP.png
51 KB, 657x527
>>53755689
>>
>>53755710
This qualifies as the bottom statement
>>
Why do people still use Bash and Zsh when rc and pdksh are vastly superior and not a bloated replacement?
>>
It's ricer trash. The type of person who uses zsh runs arch linux and spend hours fucking with color schemes.
>>
>>53755770
Pdksh doesnt support unicode. use mksh if you want a korn shell
>>
babby penguin syndrome
>>
From what I've tried of it zsh is fucking based, is it possible to run as a full bash replacement as the only shell in the system though? I've heard there are some issues associated with that
>>
>>53755851
Its more like this
>>53755623
Most people think thats just part of their term emulator
>>
>>53755801
No. That's fish shell.
>>
When will people learn to separate scripting shells (bash, sh) from interactive shells (zsh, fish)?
It looks good, it feels good and it just fucking werks (fish).

>muh pure, portable scriptz
>>
File: 1296132667417.png (12 KB, 191x234) Image search: [Google]
1296132667417.png
12 KB, 191x234
I fucking love zsh

once you get used to its history feature, you aint going to feel at home with bash
>>
>>53756231
What's the history feature?
>>
>>53756267
history in bash is arrow up will gets your pevious command

similar it is with zsh
but if you write something in there, and then press arrow up, it will give you commands from your history that contains the string you wrote

suddenly history is great again
and you find your ffmpeg command or custom lsblk command from 3 months ago in 2 seconds
>>
>>53756231
also tab completion
>>
Bash on OS X is garbage, so I use zsh.
>>
File: zsh1.webm (530 KB, 786x605) Image search: [Google]
zsh1.webm
530 KB, 786x605
>>53756333
yeah, tab completion is fucking on every step of using terminal
and I cant imagine going back to bash and have it just not do anything if theres more than one possibility..
or just fucking ignore me because I had some letters case wrong
>>
>>53756313
Is this supposed to work just after installing?
I can't seem to find it in the setup script
>>
>>53756313
That's in readline too, it's just not binded by default.

http://www.gnu.org/software/bash/manual/html_node/Commands-For-History.html#Commands-For-History

You can set those in ~/.inputrc and it will work not only in bash but all programs that use readline.
>>
>>53756333
>>53756544
Is this zsh exclusive? What other shells handle tabbing this way?
>>
>>53756544
You can do that in readline as well, bind tab to menu-complete. You also have options like completion-ignore-case, if you want.
>>
File: install_arch.jpg (519 KB, 2170x1070) Image search: [Google]
install_arch.jpg
519 KB, 2170x1070
>>53756816
I dont really know plain zsh
I always just installed some framework and it all worked
most popular is oh-my-zsh
then theres supposedl faster prezto

have a look here at the end, last item in last column is how to get zsh + prezto working...

if you want to use more popular oh-my-zsh, you just get it from your repo and do this to get premade config in to your home
cp /usr/share/oh-my-zsh/zshrc ~/.zshrc
>>
>>53756361
Install your own Bash. It's literally

brew install bash
>>
>>53755689
use a better browser
>>
>>53757069
Thank you, prezto is really cool!
The search history feature and tab completion is great.

Zsh is better than I thought!
>>
>>53757255
put this in to your .zhrc
and press ctrl+f whenever

add_sudo (){
BUFFER="sudo $BUFFER"
zle -w end-of-line
}
zle -N add_sudo
bindkey "^f" add_sudo
>>
>>53755908
Except fish is prericed
>>
>>53757281
>replacing C-f
Fucking arrow key plebs
>>
>>53757431
what is its default function in most of the terminals?
cause it sure not find or anything useful
>>
>>53757431
Why don't you remove all keys besides tab? Too "minimal" for you faggot?
>>
>>53755437
Zsh uses more RAM. Bash works well for 99% of what I do. Bash is always there on any system I need to use.

There is no good reason to switch from a tool that works to another tool just because it's different.
>>
>>53757446
Same as emacs, forward one char(like right arrow key). That one's not too bad, but you should really get used to c-p/n(up/down) and M-f/b(forward/backward words). Also c-k, c-a and all that shit, makes line editing a lot more convenient.
>>
>>53756313
this. This is so fucking awesome.
>>
>>53756313
Ctrl R in bash does the same.
>>
>>53757566
how do I use it step by step please?
I press ctrl+R then write my string or wtf?
cause I am not getting it to work
>>
>>53757566
No, that's incremental search. What he wants is available but not binded by default.

>>53756916
It's history-search-backward
>>
>>53757593
It's different, you start typing your command and it will bring up the matches.
>>
zsh is confy as fuck mates
>>
>>53757628
it will bring up first match
but how do I move to other matches if the one it brought up is not what I want?
>>
>>53755687
it does
>>
>>53757642
Press ctrl R again to go through results
>>
>>53757667
awesome
will stick with zsh of course
but i will finally not feel like having my legs tight behind my head when using bash
>>
>>53757636
ffs, I would use arch if it didn't break my urxvt when I do a system upgrade (in a way which means it segfault when I try to launch it), and if the logo didn't always remind me of a fat person standing underneath an arch.
>>
>>53757699
man, just use whatever makes you feel comfy. that's why there's so much choice.

there are a lot of great distros out there.
>>
Why should I? I'm just going to be cutting a thread with a chainsaw anyway.
>>
>>53757281
I've always used thefuck. https://github.com/nvbn/thefuck
>>
>>53757797
why this is better

1. you always see where you are adding sudo and what is being executed
2. less writing, less key presses
3. usable on commands from deeper history, not just single command back
4. when you notice you are missing sudo you can fix it the very same moment you notice it, not finishing the writing of the command and then do false execution only to be able to redo it
5. you can use it not just when your forget but because its faster than writing sudo out
>>
>>53756916
"\e[5~": history-search-backward "
\e[6~": history-search-forward"

>>.inputrc
>>
>>53757853
thefuck detects many different problems. And you just type fuck.

It also asks for confirmation
>>
>>53755689
This. 10/10
>>
Do I have to relearn a shit ton of commands again or it's enough with what I know of Bash?
>>
>>53757023
fish
>>
>>53757976
nope
its same as bash for 99% of the stuff
you would notice differences only if you would try to write some lengthy scripts, but those get bin bash shebang anyway
>>
File: 4u.png (73 KB, 702x526) Image search: [Google]
4u.png
73 KB, 702x526
>>53755638
>>53755689
>>
>>53755560
>xD lol look at my 1337 prompt guys zsh is so h4xx0r
>>
>>53758069
>>53758032
>>
Korn shell master race nobody needs bloated shells
>>
>>53757664
Confirmed
>>
>>53756544
terminal emulator?
>>
File: 1436970870389.png (165 KB, 777x656) Image search: [Google]
1436970870389.png
165 KB, 777x656
>>53758032
>>
so... uh... I just install it from synaptic and that's it?
>>
>>53759194
Is it good for scripting too or do you use sh for that?
>>
>can't tab complete shit as well

zsh is fucking annoying.
>>
File: 1458792002242.jpg (159 KB, 683x1024) Image search: [Google]
1458792002242.jpg
159 KB, 683x1024
>>53760356
No, you have to add a configuration made by these faggots and then circlejerk with other zsh users about how nice your prompt is.
>>
>>53760400
I'll get ready
>>
>>53755813
At least OpenBSD is slowly but surely porting their base to Unicode.

Can't wait.
>>
>>53760400
zsh doesn't fit the unix philosophy that these faggots are so obsessed with
>>
>>53760562
>unix philosophy
Those people don't look like unix wizards to me, they look like arch ricer fags.
>>
>>53760365
ksh is pretty much the exact same syntax.
>>
>>53760610
They still say "lol unix philosophy" to everything. But they don't even know what it is.
>>
Why do people circlejerk to shit like "Unix philosophy" anyway? Why I should I give a hoot about Unix at all? Linux could be based on any underlying code, hell call it LinDOS, as long as it's free I'm good.
>>
>using 3rd party shells
no thanks.
>on Real Unix
ksh
>on GNU/Linux
bash
>>
>>53755481
Even one extra bit that is not required for my purpose is considered bloat. I don't need a Swiss army knife with corkscrew, I just need a plain knife to cut with.
>>
File: screenFetch-2016-03-30_12-41-09.png (94 KB, 1366x768) Image search: [Google]
screenFetch-2016-03-30_12-41-09.png
94 KB, 1366x768
why not fish?
>>
Why do people still use zsh when fish is obviously superior?
>>
>>53761286
The default rice made me nope in only a few minutes of use.
>>
>>53761309
my people are here
>>53761317
rice? you can disable any of the features you don't like.
>>
>>53761350
In fish, try config_fish and help
>>
>>53761371
>fish: Unknown command 'config_fish'
>>
>>53761350
I assumed you could, but when it comes default like something straight from a /g/ desktop thread with syntax highlighting and the whole works, I just said fuck that.

In record time too, I don't think any program ever made me nope as quickly.
>>
Is (t)csh worth learning these days?

I like the idea of shell scripting with a C-like syntax.
>>
>>53761502
Maybe if you regularly use FreeBSD systems, otherwise you should probably just get used to the bourne shell.
>>
>>53761218
why not sell your computer and just buy a desktop calculator then
>>
File: images.jpg (11 KB, 216x216) Image search: [Google]
images.jpg
11 KB, 216x216
I like fish more than zsh, only two things bugg me.

1) fish_config opens in a browser, so have to setup a xforwarding session to configure headless servers.

2) doesn't compile on OpenBSD.
>>
>>53761286
First of all, because people like you use it.

>le ebin peepay froggie meemay! xD

Yeah, no.

Second, because the website is the most hysterically tryhard hipster shit I've seen in a while. The constant "le ironic hey remember when things were old?!?" joke got old almost immediately.
>>
>>53761218
so why don't you use busybox?
>>
Why do people use bash at all? It's a shitty ksh clone.

The answer is "GNU/Dick slurping".

The GNU. GNU. GNU! plus linux community is very biased towards GNU software and anything GPL licensed and always has been, so they've always shipped GNU alternatives, even shitty ones, as core system components. Gtk instead of qt, even after qt was free. Bash over ksh/zsh. Wget over curl.

Despite this, debian, the mainstream distro with the closest ties to GNU, ships their own shell as /bin/sh and relegates bash to an auxillary user-only shell rather than a major part of the OS. Based debian.

>>53761309
Nonstandard incompatible hipster retard nitpicker syntax.
>>
~> du -hs `which bash` `which zsh` `which ksh` `which csh`
344K /bin/bash
584K /usr/local/bin/zsh
748K /bin/ksh
204K /bin/csh

>using bloated shells
>not using csh

:^)
>>
How is it a drop-in replacement, when it has different syntax?
>>
>>53763848
>GTK instead of Qt
GTK is easier if you write C applications.
But Qt is being used more and more.
>Bash over ksh/zsh
I don't have any good reasons to why that is. I mostly use bash because everyone else is and it makes my life easier to know that my scripts will work on their machines.
>Wget over curl
I don't have a good reason for that.
>>
>>53755437
>why do people use what I don't use
>why people don't use what I like :(

cry more faggot
>>
>>53756313
That came bound to page up in bash by default in my distro.

I use zsh though, mostly because configuring it is much easier and much saner than in bash.

My favorite zsh feature is the ability to just do arbitrarily nested tab completions.

E.g. I can type
vim /e/p/p//ffm/
and hit tab, and it will tab complete to
vim /etc/portage/patches/media-video/ffmpeg
. Hit tab a second time and it brings up a list of patches in that directory.

(If anything is ambiguous, it partially completes + moves your cursor to the first place you'd need to type something to disambiguate, and shows up a completion list of the available options)
>>
>>53763859
>using the smiley with a carat nose
>>
>>53763929
Everyone else is using bash because linux losers forced their GPL communist garbage down everyone's throats while BSD was in lawsuitfville. But, in most cases, your scripts will work in ksh.

install
MKSH
K
S
H
>>
>>53763848
>use bash, gtk and wget because they have been my best pals in GNU for a long time
>>
>>53763848
>Wget over curl.
I'm generally a BSD-minded person but even I use wget over curl for downloading stuff to disk.

>Needing to manually repeat the filename of what you're downloading
please
>>
>>53763988
what's wrong with ast-ksh?

>>53763859
> csh considered harmful
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
>>
>>53755437
BOTNET
O
T
N
E
T
>>
Okay I installed. How do I make it work? When I open my terminal it still says bash
>>
>>53764120
zsh -i
>>
>>53764120
chsh -s /bin/zsh
>>
>>53764183
wow you really want him to go head first into zsh. Let him try it out first at least.
>>
>>53764214
>head first into a terminal
For somebody who doesn't even know how to switch the login shell there's not really going to be much of a difference out of the box.

Besides, wasn't I just answering his implicit question? Unless we disagree about what his implicit question was. I figured it as “How can I make it so that opening new terminals opens zsh?”
>>
>>53764183
>>53764228

>“How can I make it so that opening new terminals opens zsh?”
didn't work though
>>
>>53764237
Then you did it wrong
>>
>>53764237
Before you start changing your login shell and running random commands, you should probably get an introductory book on Unix/Linux.
>>
>>53764285
It worked for root. It didn't work for my user account

>>53764291
>reading
>>
>>53764303
>It worked for root. It didn't work for my user account
Then run
chsh -s /bin/zsh USERNAME
as root
>>
>>53764303
>It worked for root. It didn't work for my user account
Did you run the command as root or as your user
>>
>>53764316
he probably has to
chsh -s /usr/bin/zsh


anyways could anyone tell me what the advantages of (m)ksh would be over zsh in interactive mode?

I use dash for scripting for POSIX compliancy
>>
>>53764316
surprisingly I already tried that and it didn't work

>>53764323
both.
>>
>>53755437
next you tell me i need to use vim instead of nano.
simple is beautiful.
>>
>>53764323
>>53764337
Try logging out and back in again
>>
>>53764337
what shell did you run after you ran the command? Login? interactive? non-login, non-interactive?

if you don't know the difference then you really should read.
>>
>>53764337
>has no idea what the commands do
>runs them as root anyway
Lincucks everyone.
>>
>>53764390
>has no idea what the commands do
>what is http://explainshell.com/
I'm not THAT thick you know
>>
>>53763814
Because I use the Superior windows 10 and only stoop to a Linux users level when my plex media server on Ubuntu crashes.
>>
File: Smug_1cb38f_5762907.jpg (16 KB, 268x237) Image search: [Google]
Smug_1cb38f_5762907.jpg
16 KB, 268x237
>>53758833
>>53760223
>>
>>53764337
Did you forget to fucking reboot?
>>
>>53755580
Just slap oh-my-zsh on int, or prezto if you're anti-bloat
>>
>>53755687
Look into the GNU readline options in. ~/.inputrc. You can make it so bash only requires one tab.
>>
>>53755437
>not using fsh
>>
it doesnt work with bash scripts
>>
>>53761286
Share that pepe pls.
>>
>>53766732
https://gist.github.com/thetooth/14457eef1055b3bebded70ad5e1d64d3
>>
>>53755437
but I use zsh... why would i use something with less features lol
>>
>>53755560
- plugins
- builtin themes
- git integrations
...
>>
>>53766799
post ur powerline rice, aparently my font supports it but i can't for the life of me find the unicode chars to actually make it.
>>
>>53766831
I've just used droid sans mono for powerline from https://github.com/powerline/fonts
>>
Using Zsh but I'll switch right back to Bash the day Bash gets Zsh's autocompletion.
I couldn't give a single fuck about plugins, PS1 and shit.
>>
I use ksh. The true unix shell!
>>
>>53766929
why (interactively) use it over zsh?
>>
>>53766943
zsh is bloat
>>
>>53766943
no reason, I'm a neet idiot like 99% of /g/

oh I almost forget to throw a word with no reason or context

zsh is bloat
>>
I tried fish. I don't really need such sophisticated command line when bash is good enough.
>>
With proper readline settings, Bash is pretty ok:
set bell-style none
set colored-stats On
set completion-ignore-case On
set editing-mode vi
set enable-keypad on
set mark-directories on
set match-hidden-files on
set page-completions on
set print-completions-horizontally on
set show-all-if-ambiguous on
set show-all-if-unmodified on
set show-mode-in-prompt on


Still have to admit that args completion in apt, kill and others is a pretty good feature that Zsh has and Bash doesn't.
>>
File: 2016-03-30-15-36_scrot.png (8 KB, 312x273) Image search: [Google]
2016-03-30-15-36_scrot.png
8 KB, 312x273
used zsh for some weeks but there wasnt really one feature wich i missed while using bash.
what confuses me in zsh are the editor settings. why i have to choose between emacs and vi bindings in my shell?
i use vi bindings nearly everywhere, but in my shell they are just dumb.
>>
>>53767539
>why i have to choose between emacs and vi bindings in my shell?
Are you complaining about having an option that is available in all other shells?
Also, vi bindings in the terminal are great.

Also, your screenshot is dumb.
alias 'cd..' = 'cd ..'
>>
>>53755437
Fish.
>>
>>53767363
>Bash doesn't
Maybe your distribution didn't come with it but they pretty much all have a package for bash autocompletion.

I'm not using apt but for kill(as useless as autocompleting a PID is).

~ $ kill -
-ABRT -JUNK(32) -RTMAX-10 -RTMAX-7 -RTMIN+15 -SEGV -USR1
-ALRM -JUNK(33) -RTMAX-11 -RTMAX-8 -RTMIN+2 -STKFLT -USR2
-BUS -KILL -RTMAX-12 -RTMAX-9 -RTMIN+3 -STOP -VTALRM
-CHLD -l -RTMAX-13 -RTMIN -RTMIN+4 -SYS -WINCH
-CONT -PIPE -RTMAX-14 -RTMIN+1 -RTMIN+5 -TERM -XCPU
-FPE -PROF -RTMAX-2 -RTMIN+10 -RTMIN+6 -TRAP -XFSZ
-HUP -PWR -RTMAX-3 -RTMIN+11 -RTMIN+7 -TSTP
-ILL -QUIT -RTMAX-4 -RTMIN+12 -RTMIN+8 -TTIN
-INT -RTMAX -RTMAX-5 -RTMIN+13 -RTMIN+9 -TTOU
-IO -RTMAX-1 -RTMAX-6 -RTMIN+14 -s -URG
~ $ kill -I
-ILL -INT -IO
~ $ kill -INT
Display all 152 possibilities? (y or n)
1 13 1927 22791 26819 305 540 6081 6682 721 87
10 14 2 23 26842 31 542 6125 6687 723 88
100 14046 20 23503 26843 32 545 6198 6688 724 882
102 14053 201 23529 26844 3213 547 625 6689 746 89
103 16 202 24 27 33 553 6300 685 747 9
11 17 20515 240 274 350 557 634 686 752 90
1146 175 20534 24168 28 388 576 637 687 8 91
1162 176 20535 24459 28690 412 581 641 688 831 92
1164 17614 20566 24753 29179 42 5972 6416 689 832 929
11776 177 20634 248 29232 46 6017 643 7 833 93
11777 178 20831 24851 29552 47 6024 662 713 834 94
[...]


I'll admit that zsh does have better autocompletion but most commands you should have a bash autocomplete.
>>
>>53767539
This got me curious if I could do something like that in bash, works pretty good with aspell.

dict=~/.bash-aspell-dict

if ! [[ -f ${dict} ]]; then
while read -d: dir; do
for file in "${dir}"/*; do
[[ -x "${file}" ]] || continue
echo "$(basename -- "${file}")"
done
done <<<"${PATH}" | \
aspell --lang=en --dont-validate-words create master "${dict}"
fi

command_not_found_handle() {
echo "bash: command not found: $1" 1>&2
aspell -d "${dict}" -a <<< "$1" 2>&1 | \
sed -n 's/^&.*: /Did you mean: /p'
}


$ pacmna
bash: command not found: pacmna
Did you mean: pacman, bacman, pamon, wpaclean, pacman-key
>>
Because I'm not an autistic neckbeard lel
I shave.
>>
File: 1453278482770.jpg (165 KB, 750x990) Image search: [Google]
1453278482770.jpg
165 KB, 750x990
>>53755437
>using a shell that isn't posix compliant

>>53755560
Bloat.
>>
File: ricer-bash.png (61 KB, 1280x800) Image search: [Google]
ricer-bash.png
61 KB, 1280x800
>>53766799
We faggot ricer shit now.
>>
>>53760400
>>53760610
Holy shit the guy on the left is the fat silhouette from the arch logo
>>
>>53770743
*right
Fug
Thread replies: 156
Thread images: 17

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.