Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
the best poll is:
bash
zsh
fish
cmd.exe
powershell
COMMAND.COM
some ancient greybeard poo poo ive never heard of
the JS console in ur browser
gently caress off moo cow
checkbox poll
View Results
 
  • Locked thread
There Will Be Penalty
May 18, 2002

Makes a great pet!
ksh was legit cool and good before bash became a thing

it supported arrow keys and yes that was nifty at the time

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
doritos locos nacho flavor

SmokaDustbowl
Feb 12, 2001

by vyelkin
Fun Shoe

Shaggar posted:

doritos locos nacho flavor

https://www.youtube.com/watch?v=_sSVqaSl89A

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
I tried one of those once, the shell was very fragile

Notorious b.s.d.
Jan 25, 2003

by Reene

There Will Be Penalty posted:

ksh was legit cool and good before bash became a thing

it supported arrow keys and yes that was nifty at the time

ksh is still better than bash. the vi/emacs modes in ksh are much more sophisticated than gnu readline, which is what bash use. the scripting is at least modestly less broken.

the reason that the world standardized on bash was purely licensing. bash was almost as good, but the gpl beat the pants off having to pay at&t money, and ksh93 wasn't open sourced until it was way too late.

i'm pretty ok with that. don't let the perfect be the enemy of the good etc etc

that said, now that ksh93 is freely available there's no reason not to use it interactively in preference to bash

Asymmetric POSTer
Aug 17, 2005

Silver Alicorn posted:

I tried one of those once, the shell was very fragile

dsyp

Cybernetic Vermin
Apr 18, 2005

just never write a bash script and i'm fine with bash. the fact that people (which, unfortunately includes me at times) open a file to script a task, blank for a moment, then go #!/bin/sh, and then invariably write a surprisingly compact representation of a broad selection of standard errors and security issues, is enough reason to actually dislike bash

oh, but add the bindings
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

should have been the default

OldAlias
Nov 2, 2013

bash scripting is fun and powerful

akadajet
Sep 14, 2003

OldAlias posted:

bash scripting is fun

fun is super subjective

There Will Be Penalty
May 18, 2002

Makes a great pet!

Notorious b.s.d. posted:

the scripting is at least modestly less broken.

can you provide more details on why that's the case?

i've actually done a shitload of bash scripting

Broken Machine
Oct 22, 2010

Notorious b.s.d. posted:

ksh is still better than bash. the vi/emacs modes in ksh are much more sophisticated than gnu readline, which is what bash use. the scripting is at least modestly less broken.

the reason that the world standardized on bash was purely licensing. bash was almost as good, but the gpl beat the pants off having to pay at&t money, and ksh93 wasn't open sourced until it was way too late.

i'm pretty ok with that. don't let the perfect be the enemy of the good etc etc

that said, now that ksh93 is freely available there's no reason not to use it interactively in preference to bash

ksh is good, openbsd still uses a proper port of it and it's the standard shell on most commercial unix. set -o vi, maybe a profile and it's nice

Notorious b.s.d.
Jan 25, 2003

by Reene

There Will Be Penalty posted:

can you provide more details on why that's the case?

  • multidimensional arrays
  • hashes
  • gui bindings
  • functions have real return values instead of an exit status

ksh is a lot closer to perl or python, feature-wise

it still lacks a debugger, though. in a world where perl and python exist, you would have to be a complete loving idiot to choose ksh over a real scripting language.

There Will Be Penalty posted:

i've actually done a shitload of bash scripting

you poor bastard

i have not done any significant work on shell scripts since 2010 and if i have it my way, i never will, ever again, ever

holy poo poo is shell scripting terrible

unironically the worst idea ever integrated into an operating system

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Notorious b.s.d. posted:

holy poo poo is shell scripting terrible

unironically the worst idea ever integrated into an operating system

look at this wronghaver

shell scripts can deffo be a little messy, but they're quick and easy and make automating stuff simple

a 10-line shell script can easily do the work of a 100-line python script, and will work on the shittiest embeddedest linux u got


Notorious b.s.d.
Jan 25, 2003

by Reene

Poopernickel posted:

look at this wronghaver

shell scripts can deffo be a little messy, but they're quick and easy and make automating stuff simple

a 10-line shell script can easily do the work of a 100-line python script, and will work on the shittiest embeddedest linux u got

my rule for shell scripts is that if you ever nest a control structure, it is already past time to port to a real scripting language. ten lines will often already be over the top.

as for lovely embedded linux, if you can deal with the massive amount of forking and cpu/memory waste implied by shell, you can also deal with perl.

lastly, with respect to brevity, if python is too wordy, use perl or ruby. typically one can port a shell script to perl line for line! and perl has a real debugger.

i don't really care what scripting language you use. friends don't let friends write shell.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

some tooling i maintain consists of a wizard that fills out templates of jcl jobs which call into various parts of a 2000 line shell script that scrapes config files and then calls more shell scripts to kick off the actual tooling itself, which is in java

hail shell satan

Notorious b.s.d.
Jan 25, 2003

by Reene

carry on then posted:

some tooling i maintain consists of a wizard that fills out templates of jcl jobs which call into various parts of a 2000 line shell script that scrapes config files and then calls more shell scripts to kick off the actual tooling itself, which is in java

hail shell satan

scala makes a really really good scripting language and can be invoked with a shebang, just like shell. (you set the classpath and JAVA_HOME and so on in a "shell preamble" at the top of the file, which is ignored by the scala interpreter)

then you can call into the java tooling directly, using its native api

There Will Be Penalty
May 18, 2002

Makes a great pet!

bash does have associative arrays now

quote:

  • functions have real return values instead of an exit status

that's neat. but *most* of the time when you're writing lovely glue language garbage like most shell scripting is, the output of a function is good enough to use as a "return value" in most situaitons i guess. but yeah, there are most definitely times when i use perl.

quote:

you poor bastard

:gbsmith:

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Notorious b.s.d. posted:

using its native api

lol doesn't have one, unless you wanna count invoking main()

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Cybernetic Vermin posted:

just never write a bash script

Notorious b.s.d. posted:

  • multidimensional arrays
  • hashes
  • gui bindings
  • functions have real return values instead of an exit status
Hmm, sounds interestng.

quote:

ksh is a lot closer to perl or python, feature-wise

There Will Be Penalty
May 18, 2002

Makes a great pet!
http://blog.fpmurphy.com/2010/05/ksh93-using-types-to-create-object-orientated-scripts.html#sthash.snlyNUcl.dpbs

dear mother of god

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'


what in .tarnation

Breakfast All Day
Oct 21, 2004


i didnt know the term "shell" when i was a child so i thought this program was dos 's hell

Startyde
Apr 19, 2007

come post with us, forever and ever and ever
bash especially bash4 is cool and good op
add in mawk and vim embedded awk highlighting and you got yourselves some good hi-po fuckkn scripting

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
:waycool:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
although making each object a directory with inheritance via symlinks would be a more unixy approach imo

Gazpacho fucked around with this message at 04:36 on Aug 5, 2017

There Will Be Penalty
May 18, 2002

Makes a great pet!
just don't fucken ask me why they're called "discipline functions" or how name spaces work. i tried to find examples of the latter but it's all poo poo on stackoverflow that doesn't explain poo poo

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Gazpacho posted:

although making each object a directory with inheritance via symlinks would be a more unixy approach imo

to illustrate, here's a script that creates a board game object and invokes a method on it to initialize its board. (may contain bugs!)

Bash code:
#!/bin/bash

UNIVERSE="$HOME/universe"
mkdir -p "$UNIVERSE/instances"

createGame()
{
	local this=$(mktemp -dp "$UNIVERSE/instances" XXXXXX)
	mkdir "$this"/.state
	cat <<-'EOF' >"$this/initBoard"
		#!/bin/bash
		this="$(dirname "$0")"
		cat >"$this/.state/board"
	EOF
	chmod u+x "$this"/*
	echo "$this"
}


game=$(createGame)
sed -e 's/\$$//' <<'EOF' | $game/initBoard
  X$
 X $
X  $
EOF

Gazpacho fucked around with this message at 09:00 on Aug 5, 2017

EIDE Van Hagar
Dec 8, 2000

Beep Boop
I like conch shells

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe
it's spelled xonsh, m8

Menacer
Nov 25, 2000
Failed Sega Accessory Ahoy!

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Perl: not even once

maskenfreiheit
Dec 30, 2004
personally i use duckduckgo

Dan Quayle Treasure Trail
Dec 28, 2005

bira bira bira

zsh zsh zsh

e: also

Dan Quayle Treasure Trail fucked around with this message at 00:19 on Aug 6, 2017

Notorious b.s.d.
Jan 25, 2003

by Reene

if you really want to suffer, go dig up some dtksh examples

it's a complete motif + dttoolkit binding for ksh and it is frightening

There Will Be Penalty
May 18, 2002

Makes a great pet!

Notorious b.s.d. posted:

if you really want to suffer, go dig up some dtksh examples

it's a complete motif + dttoolkit binding for ksh and it is frightening

i posted about dtksh on page 2

gui's are also when i whip out #!/usr/bin/env perl with tk or something

pram
Jun 10, 2001
why dont more people use tcl

Asymmetric POSTer
Aug 17, 2005

pram posted:

why dont more people use tcl

tcl is/was really big in telecom 10+ years ago

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

pram posted:

why dont more people use tcl
because Stallman wrote an essay against it and also because it is bad

Notorious b.s.d.
Jan 25, 2003

by Reene

pram posted:

why dont more people use tcl

tcl is better than shell

Adbot
ADBOT LOVES YOU

maskenfreiheit
Dec 30, 2004

  • Locked thread