TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Spicing unix shell scripts

123 pointsby pareshverma91over 13 years ago

8 comments

bwarpover 13 years ago
The only thing I do and would use there is "logger". The rest is about showboating.<p>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.<p>A GUI could drive a script however via the script's API.<p>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.
评论 #3612049 未加载
评论 #3610373 未加载
zdwabout 13 years ago
Similar GUI functionality in OS X can be achieved with cocoaDialog:<p><a href="http://mstratman.github.com/cocoadialog/" rel="nofollow">http://mstratman.github.com/cocoadialog/</a><p>Comes in very handy, along with Platypus for wrapping shell scripts:<p><a href="http://sveinbjorn.org/platypus" rel="nofollow">http://sveinbjorn.org/platypus</a>
tikhonjover 13 years ago
I've found the notify-send command to be <i>really</i> useful for some of my random scripts.<p>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.<p>Some of the other tricks shown here also seem useful.
dratsover 13 years ago
I didn't know about /dev/tcp/host/port, has a nice Plan 9-like feel.
评论 #3611761 未加载
评论 #3612139 未加载
评论 #3610921 未加载
gaiusabout 13 years ago
Surprised he didn't mention Tcl/Tk as the way to do this.
boskonovitchabout 13 years ago
cool tips, but i'm worried about writing a script which isn't portable because of dependencies to some tools.
ThaddeusQuay2over 13 years ago
"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."<p>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).<p><a href="http://basic-converter.org" rel="nofollow">http://basic-converter.org</a><p><a href="http://en.wikipedia.org/wiki/GTK-server" rel="nofollow">http://en.wikipedia.org/wiki/GTK-server</a>
评论 #3611049 未加载
Craiggybearover 13 years ago
LOVE IT!