You are not logged in.

#26 2017-11-08 07:34:53

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

Steve wrote:

Those scripts came with the distro im using which is using openrc not systemd

Ah yes, I see.

Do ArchBang not have a dbus script in /etc/init.d/?

That's how Alpine manage it under OpenRC and I have a hard time turning the little bugger off.

yes this bug applies

Thanks, that's reassuring, shame you can't add to the bug report — Alad would get mad if he found out you were running ArchBang.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#27 2017-11-08 07:36:39

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

Steve wrote:

Is it just a matter of putting /usr/bin/mksh into etc/shells file as per below?

Yes, just so.

Because it is a packaging bug you will have to remember to remove the line if you ever remove the package.

Alternatively, try one of my AUR mksh versions, they are packaged correctly and will manage /etc/shells for you  angel


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#28 2017-11-08 07:40:24

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: What the shell? Bash, KornShell & zsh

Seems like there is an init.d script there.

sc@#!:~ $ cat /etc/init.d/dbus                                                           
#!/usr/bin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later

extra_started_commands="reload"

description="An IPC message bus daemon"
pidfile="/run/dbus/pid"
command="/usr/bin/dbus-daemon"
command_args="--system"

dbus_socket="/run/dbus/system_bus_socket"

depend() {
	need localmount
	after bootmisc
}

start_pre() {
	/usr/bin/dbus-uuidgen --ensure=/etc/machine-id

	# We need to test if /run/dbus exists, since script will fail if it does not
	checkpath -q -d /run/dbus 
}

stop_post() {
	[ ! -S "${dbus_socket}" ] || rm -f "${dbus_socket}"
}

reload() {
	ebegin "Reloading D-BUS messagebus config"
	/usr/bin/dbus-send --print-reply --system --type=method_call \
			--dest=org.freedesktop.DBus \
			/ org.freedesktop.DBus.ReloadConfig > /dev/null
	eend $?
}

Offline

#29 2017-11-08 07:44:41

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: What the shell? Bash, KornShell & zsh

Head_on_a_Stick wrote:
Steve wrote:

Is it just a matter of putting /usr/bin/mksh into etc/shells file as per below?

Yes, just so.

Because it is a packaging bug you will have to remember to remove the line if you ever remove the package.

Alternatively, try one of my AUR mksh versions, they are packaged correctly and will manage /etc/shells for you  angel

I will give it a try. Cheers.

Offline

#30 2017-11-08 07:45:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

^^ Actually, thinking about this Alpine needs dbus-x11 to work in X:

https://pkgs.alpinelinux.org/packages?n … aintainer=

So maybe Mr. Green doesn't want to mess around with that, which is fair enough.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#31 2017-11-08 20:57:48

ohnonot
...again
Registered: 2015-09-29
Posts: 3,773
Website

Re: What the shell? Bash, KornShell & zsh

i don't understand why so many people use the word "bashism" as if it was something bad.

some time back i had an epiphany when i realised how much faster dash executes compared to bash, and i started writing scripts for it, instead of bash.
however, i very soon realised that it has limitations and instead of resorting to external utilities & pipes, i can use pure bash to script that.
by now i have a good rule of thumb for how simple a script can be to benefit from dash, and how complex to benefit from bash.

you just use the right tool for the job.

(of course i have not yet compared to ksh and mksh and zsh etc., and i suspect dash might only implement a subset of what POSIX encompasses)

Offline

#32 2017-11-08 21:33:59

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

ohnonot wrote:

why so many people use the word "bashism" as if it was something bad

Bashisms aren't bad per se but sh scripts run quicker (unless the bashisms themselves allow a performance advantage) and are lighter on resources, provided /bin/sh isn't linked to bash (as it is in Arch).

Also, the added features of bash will inevitably introduce extra bugs and vulnerabilities.

ohnonot wrote:

i suspect dash might only implement a subset of what POSIX encompasses)

Dash is described as a "POSIX-compliant shell" so it should have everything defined in the standard.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#33 2017-11-08 23:34:09

ratcheer
Member
From: USA
Registered: 2015-10-05
Posts: 212

Re: What the shell? Bash, KornShell & zsh

I'm currently reading the mksh web page. It is hilarious (to a tech nerd). E.g., "An inofficial port for OpenBSD is available. Nobody dares commit it though, so it only gets updated on request.", among other snide comments.

Tim

Offline

#34 2017-11-09 07:04:06

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

^ Yes, the MirBSD developer used to be an OpenBSD dev but he had a difference of opinion with Theo de Raadt.

I keep meaning to ask him to update his OpenBSD port 'cos it won't build in my -current system but I haven't plucked up the courage yet big_smile


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#35 2017-11-10 22:34:51

malm
jgmenu developer
Registered: 2016-10-13
Posts: 411
Website

Re: What the shell? Bash, KornShell & zsh

@ohnonot: Fair challenge. Please don't take my previous post to mean that I don't like bash. In fact, I do quite like it and have probably written more script in bash than anything else. And I absolutely agree with you, it depends on what you're using if for.

The reasons that my "taste" is leaning towards POSIX shell compliance are slightly older/deeper; and they have nothing to do with speed and security. For the types of scripts I write (glue for other programs), speed generally isn't a priority. If it was, I would probably use C or python. I have little knowledge of shell security, so wouldn't want to comment on that.

So what is it then? It think it comes from having wasted too much time re-writing code and a fear of things breaking. Some of these scars are portability related. And of course, it's not just "shell" but also all the programs called from the shell scripts. Many commands (e.g. ps, grep, sed, find) come with various extensions or implementation specific features. If any of these do not behave as you had hoped, the script often fails in spectactular ways (from experience smile)

I guess most coders eventually conclude that good code doesn't make assumptions that might not hold true in the future, fails early, is clean/simple, etc, etc; and in the end they look for commonality, standards, specifications and APIs that don't change too much. So whether you are writing html/js/ccs to work on all common browsers, or C89/99/11 to compile on common BSD/Linux platforms (or even Windows/OSX) or anything in-bewteen, the thought of a standard becomes quite appealing. For most Unix shells, the POSIX shell standard is this last common reference point (="highest common denominator").

Now, please don't think that I'm writing all this from the pious position of a good programmer. I make every coding mistake going. And maybe I should re-think. I suppose bash is rather dominant in the Linux world, and maybe bash4 is a good cross-platform standard. Food for thought.

Offline

#36 2017-11-11 09:04:45

ohnonot
...again
Registered: 2015-09-29
Posts: 3,773
Website

Re: What the shell? Bash, KornShell & zsh

^ no problem; i wasn't refering to you personally anyway.
that word is just some sort of fashionable thing to say dismissively in certain communities.
strangely, nobody says "zshisms"... big_smile

anyhow, it depends on the job:

Head_on_a_Stick wrote:

sh scripts run quicker (unless the bashisms themselves allow a performance advantage) and are lighter on resources, provided /bin/sh isn't linked to bash (as it is in Arch).

PS:
i read somewhere that bash, if invoked via /bin/sh runs a stripped-down version of itself.

Offline

#37 2017-11-11 14:13:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: What the shell? Bash, KornShell & zsh

ohnonot wrote:

i read somewhere that bash, if invoked via /bin/sh runs a stripped-down version of itself.

From bash(1):

If  bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. [...] When invoked as sh, bash enters posix mode after the startup files are read.

Last edited by Head_on_a_Stick (2017-11-11 14:14:30)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#38 2017-11-11 14:52:48

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: What the shell? Bash, KornShell & zsh

i like the fact that mksh/ksh does not have a history ootb, makes the human memory work.

Offline

#39 2017-11-11 16:53:23

ohnonot
...again
Registered: 2015-09-29
Posts: 3,773
Website

Re: What the shell? Bash, KornShell & zsh

Head_on_a_Stick wrote:
ohnonot wrote:

i read somewhere that bash, if invoked via /bin/sh runs a stripped-down version of itself.

From bash(1):

If  bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. [...] When invoked as sh, bash enters posix mode after the startup files are read.

it does not mention making itself lighter/faster.
i might have misread that.

Offline

#40 2019-04-09 20:00:44

Colonel Panic
Member
Registered: 2018-11-13
Posts: 65

Re: What the shell? Bash, KornShell & zsh

I recently installed one called fish (short for the friendly interactive shell) in Debian. I'm not acquainted yet with most of its features but I like the different coloured text (it allows for 256 colours) in the prompts.

Here's the wiki for it, and a cheat sheet mentioned on the talk page;

https://en.wikipedia.org/wiki/Friendly_ … tive_shell

https://www.cheatography.com/myounkin/c … ish-shell/

Last edited by Colonel Panic (2019-04-09 20:02:41)

Offline

#41 2019-04-09 20:47:43

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 328
Website

Re: What the shell? Bash, KornShell & zsh

Its own web states "Finally, a command line shell for the 90s" -- sounds 'promising' :-)

The latest release is dated Feb. 19, 2019 so I guess it is only the slogan that is lagging.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#42 2019-04-09 21:27:26

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,400

Re: What the shell? Bash, KornShell & zsh

Martin wrote:

Its own web states "Finally, a command line shell for the 90s" -- sounds 'promising' :-)

The latest release is dated Feb. 19, 2019 so I guess it is only the slogan that is lagging.

/Martin

They could change it: "Finally, a command line shell for the 20s"

20-01, 20-02, 20-... ... ... 20-97, 20-98, 20-99   devil

Last edited by Sector11 (2019-04-09 21:27:50)


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: d67 Kernel: 4.9.0-9-amd64 x86_64 (64 bit gcc: 6.3.0)
Desktop: Openbox 3.6.1 Distro: Debian GNU/Linux 9 (stretch)

Offline

#43 2019-04-10 07:49:47

Jimbo_G
Member
From: France
Registered: 2017-05-12
Posts: 125

Re: What the shell? Bash, KornShell & zsh

Or maybe they just mean the 2090s  wink

Offline

#44 2019-04-10 18:57:47

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 328
Website

Re: What the shell? Bash, KornShell & zsh

I played around a little with the on-line try-out. I found it refreshing. Probably a pretty good idea for people who are occasional command line users.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

Board footer

Powered by FluxBB