[home] [<-back] [index] [next->]
____________________________________________________________________ [16:. - [ Leet Shell-Scripting, Part One ] [MagicTux] :. ] [magic.tux@gmx.net] :. ] ____________________________________________________________________ Cheers go out to WIZKID for correcting one of my articles and making me look really stupid - Thanks man! Before WIZKID gets a chance to make me look really stupid again, I'll correct myself: No. 10 in my getting good grades in school article was meant to be "bribe your teacher", not "blackmail your teacher". I was just kind of weird. First, I'd like to start with some great quotes: 'A true friend stabs you in front' - No idea whose this is 'So many untalented people are making so much money in the music business these days' - A Spice Girl 'Explaining a joke is like dissecting a frog. You can do it, but it dies in the process.' - No idea here either What is this really weird article about? It is about writing neat shell-scripts. About using dialog boxes in your shell scripts. First of all, to be able to get the full advantage of this article, you should be using either the Bourne Shell (/bin/sh) or the Bourne Again Shell (/bin/bash). These usually come with Linux and various other Unix clones, though Solaris (aka Slowlaris) (as far as I know) doesn't come with bash, stupid as it is. So if you don't have it, be smart and search for it yourself. You can probably find it almost anywhere (including http://www.tucows.com *hint hint*) You have to be on a Unix clone by the way (*DUH!*). Also, of course to be able to use the dialog boxes in your shell scripts, you'll need the program/library that enables you to do this. You can download it at: ftp://sunsite.unc.edu/pub/Linux/utils/shell/ The most recent version (at time of writing this article) is: dialog-0.6z.tar.gz (Actually, seeing as the last update of dialog was a few years ago, I think 0.6z will remain the most recent version for quite a while) So, once you've got that installed you can proceed to the rest of the article. I recommend editing the 'colors.h' file before installing, otherwise the colors used will look really crappy. Also I recommend taking a look at the examples that come with it in the 'samples' directory. My scripts are based on them, just that I improvised. *** CONGRATULATIONS *** You have managed to install dialog, this article is now over! Ok, sorry about that ... it was meant as a joke, but it was, I guess, just too cheasy. That's my humor for you... While looking through some packages, I found this interesting think called 'dialog' that was supposed to enable you to use dialog boxes in shell scripts. Well, after playing around with it for a while I decided to document it. Here it is ... I didn't get everything to work, maybe you can though. So I'll just write about what I managed to get to run. You can also sort of see this as a simple guide to shell scripting. Let's start with taking a look at our options here ... dialog version 0.62. Display dialog boxes from shell scripts * Usage: dialog --clear dialog --create-rcdialog [--title