BASH

It's so beautiful, everyday I learn something new, every day I learn there is a more effective way of doing something. I love the raw power of bash scripting. The freedumb, everything. Post useful bash scripts here.

Other urls found in this thread:

gitgud.io/cloveros/cloveros/blob/master/livecd_build.sh
doc.cat-v.org/plan_9/4th_edition/papers/rc
alpinelinux.org/
gitgud.io/cloveros/cloveros/blob/master/home/user/stats.sh
sta.li/
twitter.com/NSFWRedditVideo

bash is harmful, bloated shit.
take the rc-pill.or at least use ksh

busybox ash.

#!/bin/zsh

if [ -z $1 ] ; then
return
fi

date
sleep $1;
aplay /dev/urandom

gitgud.io/cloveros/cloveros/blob/master/livecd_build.sh

I only use bash because it's the default on every distro and it has autocomplete.

I hope you're at least writing all your scripts against #!/bin/sh.

See: It also has autocomplete

whats rc

plan9 shell
he's autistic

Named pipes and Anonymous Named pipes. For example
diff

Shell from Plan 9. It's not POSIX compliant and deviates a lot, as nearly everything in Plan 9.
doc.cat-v.org/plan_9/4th_edition/papers/rc
You can get it on Linux from either its own package, 9base or plan9port
Faster, cleaner syntax, more piping capabilities.

named pipes came from ksh and tail is a standalone program you retard

>Using something rob pike designed

>not naming it nogozone.jpg

guys check this out.
There's even a distro based around it!
alpinelinux.org/

It's implied

>#!/usr/bin/env bash

And what didn't came from ksh? Bash brought nearly no innovation ever.

gitgud.io/cloveros/cloveros/blob/master/home/user/stats.sh

sta.li/

>try to paste code into Sup Forums
>Connection failed

Why can't Sup Forums properly sanitize their inputs without outright blocking them?

/etc hosts triggers the filter, it'

dont use the quick reply box for code

Security is hard, goy.

Blocked

Your IP or IP range is blocked from accessing Sup Forums.


What did moot mean by this?

Bash isn't bloated though.

How come bash shortcuts are such shit? Why can't it have shortcuts that of a normal word processor?

it literally is tho
1. noticeably slower
2. bigger executable size
3. at least 58 builtin commands. rc has 12.

you are free to rebind the keys in whatever way you like, brainlet

it also lacks basic features like multi-dimensional arrays that ksh had since 1993

>he doesn't use a shell with only 1 command

Exec?

set -o vi

Thank me later.

well you need cd because it changes state, but then you'd also need .

>you are free to rebind the keys in whatever way you like, brainlet
That doesn't excuse shitty control key + letter combos, they are harder to remember and have absolutely no discoverability. Superior control key + navigation key combinations that every single word processor has beat bashcrap.

let's meet right in the middle and use this desu

You can thank Stallman for that - the default key combinations are based on EMACS.

Or use a full-featured interactive shell like zsh and write scripts in superior dash and ksh.
I don't think there's much use in running busybox sh as interactive shell unless you have huge memory constraints.

t. Moortuguese "Software Developer"

busybox shell has tab-completion, and in my (limited) experience with alpine, I didn't notice any problems with it as an interactive shell.

man bash, BUGS section
>It's too big and too slow.

fun fact: rc commands written as rc script are faster than bash builtins

>he hasn't set every single combination of letters below 12 characters as an alias for "cd ."

rc is crap

at least with ksh you can assume the shit you write might run on bash too

tcsh > *