What shell does everyone use?

What shell does everyone use?

I recently installed Arch and I've been using pic related, but it's pretty plain. Is there any advantage to using another shell like zsh or fish?

Other urls found in this thread:

mywiki.wooledge.org/Bashism
erlang.org/doc/man/escript.html
twitter.com/AnonBabble

I use tmux with out of the box oh-my-zsh.
Works pretty ok I guess

screen with mksh.

openbsd-pdksh on OpenBSD, mksh on OS X and Linux

bash or almquist

fish
It's fucking awesome.

i use oh-my-zsh because of a theme that I like a lot, but all my shell scripts are in bash

i really cant tell teh difference between both

fish is THE shell
but since you're an arch cuck you'll probably install zsh for hipster status.

>uses fish
>calls others hipsters

Most people will do just fine with bash. If you do a lot of shell scripting you might find zsh to be more up your alley. In particular, I use it because bash strips out newline characters when you save a multiline output as a variable. I find that annoying as fuck. zsh doesn't do that.

bash because work

bash

i fucking hate bash, but it's the only shell i know and it's installed literally everywhere

bash scripting is an abomination that needs to be nuked from orbit, but it will never die

i'm trying to learn bash scripting. can anyone recommend any good books/websites I should check out?

Learn POSIX shell scripting with sh/ksh instead.
Then search the internet for two books.
Unix shell scripting by stephen kochan
and the ksh oreilly book.

Any specific reason why bash is not recommended?

doesn't encourage portability

Bashisms.
mywiki.wooledge.org/Bashism
Plus, any Unix book will really only teach sh/ksh.
but that might have changed since I was learning sh scripting.

horrible syntax. oh, i need to do a comparison? okay, so do i use -eq, or == or....

impossible to debug

no typing

the list goes on

coming from a complete noob - how is this so? It seems like it's installed everywhere unix wise.

it really isn't, BSDs don't have it for example

It's not. sh is what you want for portability, it's actually everywhere

It's everywhere Linux is, but not Unix. We have many Solaris boxes without bash installed. korn shell (ksh) was/is the Unix standard since the early 90's with SysV.

SysVR4 to be exact.

my fault on the unix/linux distinction. Thanks for the clarification though, I didn't know of korn shell being the existing standard until going through this thread.

This is all good to know though. I've started getting into shell scripting at work recently as we have no admin and a ton of shit in the environment that needs to be automated and handled in appropriate manners. I've been writing things in bash, but perhaps to stay with the standard is I should try some things out in ksh. Though, I suppose it would be best for me to make my mind up and pick one...

note that you CAN write portable scripts in bash, but a lot of people seem to fall for the bashism trap

Fearful of showing my ignorance here, but. . .

I suppose I don't understand the context of portability here.

well let's look at screenfetch for example

literally all it does is display system information and ascii art, right? yet somehow, the author wrote it so it only worked in bash

there's absolutely no reason for it to be that way

so let's say you write a script in sh or even ksh, it'll most likely work with most POSIX shells

never use bash for learning

fair point.

even better point. To someone completely new and in the beginning stage (move these files here, zip, etc.) this hits home. Looks like I should change my learning direction and read more up on posix standards.

more correctly put -- learn shell programming in a posix friendly shell.

man test

scripting in bash kinda sucks. if you don't already have a scripting language, go learn Python.

zsh for hipster, ha. I don't use zsh, but if its hipster I don't even dare try to guess what fish is like.

From what i have read so far, it's a bit unintuitive.

This is good advice, but only after your bloodied your knuckles with sh, sed, awk. You can spare yourself from Perl, but yeah most scripting is now done in Python, Ruby, erlang...etc.

I like awk

>fish
>using a broken shell
cat | begin; cat; end

I thought you were serious, but then you threw in scripting in erlang... next you'll suggest scripting in C.

it's out there.
erlang.org/doc/man/escript.html

i script in assembly yo.

Python

I saw some posts about using Swift as a general scripting language, as well as for programming OS X/iOS applications.

Does anyone here use swift? I hear it's popular with devs but I'd like more information

Bash on ubuntu on windows

>I hear it's popular with devs
Just for the apple ecosystem. It's useless everywhere else.

Why? I consider using fish instead of zsh but I have no deeper reason than entering the kool kidz klub.

The news I saw was a sort of limited use scripting language from IBM.

also, they just bumped the swift version and everyone has to upgrade now... I'm a little turned off by it, but maybe for someone with a blank slate regarding languages it would be ok..

Makes sense, now that IBM is pretty much MacOS/iOS everywhere that isn't a server.

yes, IBM is pushing swift heavily for linux. it's become quite popular.

Former fish user here.

The problem with fish (as a login shell) is that lots of things rely on your login shell being compatible with POSIX sh.

I only use zsh to have nice autocorrect but that's it really

Bash and rc.

It's so ironic to me that the best shell I've ever used by far was PowerShell. Typed pipelining between instances in fucking Windows? What is this sorcery?

this

I use csh as interactive shell.

For plain scripts I use sh, for anything more complicated I prefer to use bash or python, usually python.

Fair enough but should one really need so many shells for different tasks?
Surely you could create a manageable equilibrium?

Cerrtainly, best tool for the job. Although CSH is default login shell on my OS and works well - no reason to change it, sh is just like everywhere else as POSIX compliant default shell for /bin/sh.

The only reason I install bash is for if I come across something that *really* needs it, otherwise I would remove it since it is unused.

I was recently dicking around in a bash script and I found a brace expansion or two that zsh doesn't fully replicate. So now everything login defaults to sh, I need to #!/bin/bash, and zsh is pretty. If I was really autistic I bet I could drop in a nice bash config and make it as good or better than zsh.

Probly wont.

Long time ksh user, about a year ago I switched over to bash for my general login shell. From general daily use, they were pretty close on the features I use, plus being on nearly every system it's easier to switch.

>2016
>not using eshell

zsh

And this is the only response you will get for this post.

Bash works.

If it works, I use it.

Simple.

You cant use bash here...
You will not look cool.

who /oo/ here

tcsh on freebsd

>it'll most likely work with most POSIX shells
And why would you care about that?

cmd.exe on wine on bash on ubuntu on windows

I use Bash, and ksh. It's all about personal preference though. Different shells may have different features but you shouldn't be writing non-POSIX compliant scripts, so it really shouldn't matter which one you use for day to day stuff.

For your root shell however you should in most cases stick with the default. OpenBSD is the only OS I can think of where changing it is not a problem.

>but you shouldn't be writing non-POSIX compliant scripts
Why not?

...

>not having sudo !! out of the box and have to install a function for it

FUGGING DROPPED

do you really think something as simple as screenfetch not working with ksh is acceptable

Bash isn't cool enough for hipster faggots who don't have the slightest clue of 98% of the shit it can do. Bash is fine for everyone else.

echo -e "\ua0\u25b2\n\u25b2\ua0\u25b2"

ok grandpa

I've been running fish for almost a year now as my login shell. It's very rare that something doesn't work and the few times something has broken, I've submitted fixes upstream

I use fish

zsh is basically bash with some really useful features; i prefer zsh but bash is fine.

That's changed. Typing !! inserts the previous line where you were typing.

>powershell
no

eshell + tramp ftw
tfw > find-file /ssh:someremote:/etc/file does what you mean

Now that powershell is open source will someone backport the latest version to 7 :^)?

>impossible to debug
tfw too dumb to use tee.
If you want replace bash with something than it should be dash.

You can have it and it's one of the first things i install to OBSD. csh/ksh... my compatibility fly away.

sh is bash on loonix (or dash), but you can replace it. OBSD as i know use csh for it. Or ksh. XD benis

>but not Unix
and Unix is in the ebin.
>never use bash for learning
The industry standard? Your CV in the ebin.

WHY? Is this a MUH UNIX thing I am missing.

At we ship our RHEL builds which KSH so that our devs don't have to update their shell scripts from solaris, irks me to no end.

bash
it's the most convenient to me

I've tried arch; zsh hurts my head. and no not really, with perl and python there's no point in bash scripting really.

WHY what?

what is this supposed to do?

Why wouldn't you want to?

ksh93 is very fast compared to bash and zsh

No. Its a shell, its going to run POSIX shell code. These days production environments pretty homogeneous unless you work at retarded company still using AIX, HP-UX, Solaris or worse some combination of them its pretty much going to be all Linux. If you are going to write code so important it will outlive Linux then the shell is probably the wrong tool for the job anyways.

Bash supports these things though. Since bash 4.0.2 its pretty much fully compatible with KSH minus a few syntactical things like typset vs () for array declaration.

> -eq vs ==
-eq for numeric and == for string comparison, this isn't difficult stuff.
>impossible to debug
bash -x or set -x, it gives you quite a bit of information.... I'm confused what is easier to debug then bash.

info history 'event designators'

Scripts written in Bash aren't portable because not everything has Bash. sh is what you want for portability, it's everywhere.
>inb4 lol just install Bash
>needing to install a whole fucking shell just to use some shitty little shell script

Its really only practical if you need pythons data structures. Often this can be avoided if you know AWK which for some reason I rarely find people who have read enough to use awk beyond a field separator.

Powershell is a failed abortion and you know it. Piping one object to another isn't that great and its syntax is horrible.

obj | % {$_attrib_name}

I mean wtf is that.

#!/usr/bin/env bash

Honestly I find that 99% of the time the bash vs sh debate is fucking useless. First of all, sh itself is absolutely atrocious. It's uglier than bad FORTRAN code, it's unpleasant to look at, it's a syntactic mess. It is however useful. Bash is essentially a hack on top of a hack in the hopes of getting two wrongs make a right, with from what I can recall minor success. Neither are particularly good. However, personally I enjoy occasional bashisms just the way I prefer make over mk.
Secondly, from what I've seen (while I have not yet had the pleasure of being a proper sysadmin I helped out occasionally) and experienced myself most (ba)sh scripts are either hacks to get something to work on "that one machine" or "that condition" or automate some process relevant to your current setup (checking which serves are up, maintenance,..). This means that for the average end-user "portability" is of no value since 99% of the scripts will never see another machine.

Of course writing bash scripts like screenfetch and using bash is a bad idea, generally. But that is the 1% application. And unlike people that like to proclaim insignificant modifications to an old (and arbitrary) standard "harmful" I see no reason to adhere to POSIX for it's own sake.

This. I only use zsh for the pretty colours.

Because it's a horrible habit to get into

>There are people who are using bash and not zsh right now
Why? zsh is literally bash but better

no, no it's not. At least not in general. Why the fuck would I give a shit about POSIX if I have no practical reason to?

>no, no it's not. At least not in general.
It definitely is.
>Why the fuck would I give a shit about POSIX if I have no practical reason to?
Because you can accomplish the same shit and have portability should you need it. There is literally no reason to lock yourself to your current system.

there is if you prefer the ugliness of bash over the ugliness of sh. Especially for people using bash scripts primarily to tweak their current, specific system. Portability is nothing that has worth in and of itself.

>not contributing shitty scripts to the community

kek, exactly

I use mir-bsd ksh for interactive day-to-day use. It's smaller and faster than bash (and also zsh and fish). It's being actively developed. And it has the ksh co-processes.
and I use dash for running small scripts efficiently.