LWN.net Logo

add sh/bash to pain list

add sh/bash to pain list

Posted Feb 22, 2007 3:06 UTC (Thu) by k8to (subscriber, #15413)
In reply to: add sh/bash to pain list by b7j0c
Parent article: The Road to KDE 4: CMake, a New Build System for KDE (KDE.News)

I've used a lot of "more full featured language as a shell" tools over the years. I've given all of them fair shakes, tried to use them in real environments for weeks or months.

In the end they all suck.

Reasonable languages tend towards explicit. Shell really needs to do a lot of implicit to make life typing the stuff in reasonable. This is why tcl and perl fare much better as shells than python does, for example, since python syntax actually shows you what's a number and what's a string, and so on, wheras perl for example likes to hide that. But even perl and (even better suited to being a shell) tcl tend to fall down with requiring too much obnoxious syntax to do things that are just plain easy with bourne.

Shell is an interactive program first, a language only very secondarily (don't let the kool-aid drinkers say otherwise). A programming language can only really be a shell very secondarily. This is one of the reasons Monad sucks, for example.


(Log in to post comments)

add sh/bash to pain list

Posted Feb 22, 2007 5:59 UTC (Thu) by drag (subscriber, #31333) [Link]

To see the ultimate expression of this check out Microsoft's Monad.

It's a .NET scripting language trying to pass itself off as a user interface.

The healthier example is ipython. And that is nice in the way that it doesn't pretend to be anything it's not, which is a improved python shell (which has always existed) to make a easier to use and freindlier python development environment.

Bash isn't that bad. They've been steadily improving it as time goes on.

I don't know how stupid or obvious this is, but I just learned about it not long ago, but the backticks are now deprecieted.

The improved method is to use (). Like such:

echo $(echo $(echo $(echo 'hello world')))

So that would be impossible with backticks, or at least so hard I don't know how to do it. It's certainly a lot more convient.

Maybe it's time to re-evaulate it? I donno.

If you want a thing that is specificly designed to be easy to use is:
http://fishshell.org/

It's pretty neat. One of things about it is that it supports some of the newer Freedesktop.org standards like the *.desktop files.

For example if you go:
open foo.bar

Then it will look up the mime type and then launch your default application for that file. It's kinda new and a lot of the <application>.desktop files are broken but it's nice non-the-less.

Kind a like the shell for normal people.

add sh/bash to pain list

Posted Feb 22, 2007 6:16 UTC (Thu) by drag (subscriber, #31333) [Link]

Here are a few things I found real quick.
Bash debugger
little article about using bash completion
a longer article from IBM about bash improvements

add sh/bash to pain list

Posted Feb 22, 2007 12:58 UTC (Thu) by nix (subscriber, #2304) [Link]

$(...) has been in POSIX for, oh, years: I know I was using it on Solaris in 1996. I think it dates all the way back to ksh88.

And you're right, there's no call to use `` anymore at all. They're not even easier to read than $(...).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds