Stronger Shell
m.odul.us
Stronger Shell
1–10 of 80 posts
Re: Stronger Shell
#2Re: Stronger Shell
#3Re: Stronger Shell
#4That's because '[[' is a special bash extension which started out as a better '[' which is actually a binary (/usr/bin/[). And, well, you have to have a space between an executable and its first argument.
(nowadays '[' and '[[' are builtins in most shells, but the external binary still exists).
Re: Stronger Shell
#5If you don't know how to use your shell, block yourself off an evening with this book and change how you forever use you computer.
Re: Stronger Shell
#6Re: Stronger Shell
#7Bash/sh is a horrible programming language.
Re: Stronger Shell
#8I personally can't stand bash for writing scripts (it's fine for typing one-liners into terminal though). This question and its top answer capture the insanity of bash quite nicely http://stackoverflow.com/questions/3601515/how-to-check-if-a... .
I've briefly looked at rc, but while it's significantly simpler and more orthogonal than sh it's got it's own weirdnesses; but the 'Design Principles' section here is worth reading: http://plan9.bell-labs.com/sys/doc/rc.html
Surely there must be a usable shell wrapped around an actual modern language?
Re: Stronger Shell
#9I write my scripts in PHP if they're moderately complex, and only use Bash for dumb lists of commands.
Re: Stronger Shell
#10I personally can't stand bash for writing scripts (it's fine for typing one-liners into terminal though). This question and its top answer capture the insanity of bash quite nicely http://stackoverflow.com/questions/3601515/how-to-check-if-a... .
Is there a better shell? By which I mean more flexible, more consistent, and simpler. (Anyone who says 'zsh' is disqualified.) I've briefly looked at rc, but while it's significantly simpler and more orthogonal than sh it's got it's own weirdnesses; but the 'Design Principles' section here is worth reading: http://plan9.bell-labs.com/sys/doc/rc.html Surely there must be a usable shell wrapped around an actual modern…
It has two modes, which can be a bit confusing. A python mode and a bash-ish mode.
testdata = $(ls -l) #Takes thes bash command 'ls -l' and saves it to the python variable testdata
echo ${testdata.upper()} | grep XLIO
$(ls).split("\n")
It uses some magic to figure out whether you're in a python context or a bash context, defaulting to python. If you save some stuff to a variable called "ls", you need to del(ls) before you can use ls as a command again.