News for hackers. Stuff that matters.
Re:Tools To Add Some Spice To Your UNIX Shell Scripts by sumeeta on Monday April 19, 2010 @07:34PM (#1278164)
I think it’s easy to get stuck thinking you have to use bash and the UNIX utilities for sysadmin tasks.

Automating some more complicated stuff is just a pain in the ass to write and maintain if you just use bash, sed, awk, grep and friends. Free your mind and don’t be afraid to pull out Perl, Ruby or Python and apply liberally.

Re:Tools To Add Some Spice To Your UNIX Shell Scripts by holygoat on Monday April 19, 2010 @07:14PM (#1278136)
s/UNIX/Linux, by the look of things... not quite what I was expecting.
Re:Tools To Add Some Spice To Your UNIX Shell Scripts by bcl on Monday April 19, 2010 @10:15PM (#1278406)
Wow. That was... underwhelming.
Re:Tools To Add Some Spice To Your UNIX Shell Scripts by gte910h on Monday April 19, 2010 @06:32PM (#1278050)
I'm an old school unix guy who's now an iPhone developer; Any word on which of these work on mac?
Re:Tools To Add Some Spice To Your UNIX Shell Scripts by Hoff on Monday April 19, 2010 @10:37PM (#1278448)
For user notification, get yourself Growl.

tput and reset are present.

If you really have a VT serial terminal, then setleds is going to be an echo and a tr to ship out the escape sequence. Might be a different (or easier) way...

If you're working with a standard Mac keyboard (and not a VT terminal), here you go http://googlemac.blogspot.com/2008/04/manipulating-keyboard-...

Applescript can do dialogs (there are hooks in Xcode) or the Applescript editor. (You can get the scripts stuff up in the menu bar for quick access.)

logger is present in Mac OS X.

pmset is a path akin to setterm.

smbclient is available. (Few Windows boxes have this path open, however.)

There are various approaches for the tcp stuff. Start with nc (netcat), which is built in.

Re:Tools To Add Some Spice To Your UNIX Shell Scripts by makecheck on Monday April 19, 2010 @07:00PM (#1278115)
"tput" exists in /usr/bin. I imagine bash sockets would work properly. I'm not aware of Mac versions of the others.

It is possible to use Python to display GUIs from the command line on Mac OS X, e.g.

  env VERSIONER_PYTHON_PREFER_32_BIT=yes python
  >>> import wx
  >>> app = wx.PySimpleApp()
  >>> wx.MessageBox("hello, world")
AppleScript is capable of this, but "osascript" doesn't allow GUIs to pop up when run from a shell.