

Spicing unix shell scripts - pareshverma91
http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html

======
bwarp
The only thing I do and would use there is "logger". The rest is about
showboating.

A GUI and a script should never be entangled if you ask me. There should be no
coupling there. Everything script-related should run quite happily non
interactive.

A GUI could drive a script however via the script's API.

I think ESR wrote about this in TAOUP (The Art Of Unix Programming) but I
can't be bothered to dig through it now for the reference.

~~~
gbrindisi
TAOUP?

~~~
pewfly
The Art Of Unix Programming

------
zdw
Similar GUI functionality in OS X can be achieved with cocoaDialog:

<http://mstratman.github.com/cocoadialog/>

Comes in very handy, along with Platypus for wrapping shell scripts:

<http://sveinbjorn.org/platypus>

------
tikhonj
I've found the notify-send command to be _really_ useful for some of my random
scripts.

I used it to notify me when a particular web page changed, but I think it
could also be very useful for letting me know when a long-running script
finished.

Some of the other tricks shown here also seem useful.

------
drats
I didn't know about /dev/tcp/host/port, has a nice Plan 9-like feel.

~~~
lambda
Only available on Linux.

More portably, you can use something like netcat or socat.

------
gaius
Surprised he didn't mention Tcl/Tk as the way to do this.

------
boskonovitch
cool tips, but i'm worried about writing a script which isn't portable because
of dependencies to some tools.

------
ThaddeusQuay2
"There are some misconceptions that shell scripts are only for a CLI
environment. You can easily use various tools to write GUI and/or network
(socket) scripts under KDE or Gnome desktops. With the following tools you can
build powerful, interactive, user friendly UNIX / Linux bash shell scripts."

What's even better is that you can use BaCon to unify, and expand upon, pretty
much everything mentioned in the article. BaCon is Basic Converter, created by
Peter van Eerten, who also created GTK-server, which provides a stream-
oriented interface to GTK, and which can be used with BaCon. Convert your
shell scripts to BaCon, which then turns them into C, which is then compiled.
Any calls to external commands can remain. Switching from shell scripts to
BaCon is easy, you can stick with the tools you know, you can have as much GUI
as you like (while remaining at the CLI), and the executables are lightning
fast (compared to shell scripts).

<http://basic-converter.org>

<http://en.wikipedia.org/wiki/GTK-server>

------
Craiggybear
LOVE IT!

