[clue-tech] The Really Fast Way

Michael J. Hammel mjhammel at graphics-muse.org
Fri Nov 9 08:21:06 MST 2007


On Fri, 2007-11-09 at 00:33 -0700, Nate Duehr wrote:
> Or if you do, they get typed into a script file so you can run them  
> again and again to your heart's content with a much shorter name.  :-)
> Who needs a GUI when you have a shell?  :-)

Interesting question:  why would you use a GUI then?

Sheer numbers and a bad memory, in my case.  I have a ton of little
scripts that do specific things:

- run xhost on specific hosts on my home network
- mount/umount remote servers
- set up tunnels to/from work
- remotely launch scripts on other machines

These change on an infrequent (but not "never") basis.  So they make
better shell scripts than shell functions.  I can tweak the script
without restarting X or relaunching a shell. They have no UI, but
launching from a GNOME menu (re: "drawer") via a custom application
launcher makes it quick to setup or take down specific configurations
within my desktop.  I even used to enable and disable my daughters net
access this way using custom IP tables until I finally got a WRT54G and
stuffed DD-WRT on it. Drawback - no interactive error reporting (though
that could be handled with xmessage or similar).  But remembering what I
called these can be a pain.  I know where I put them (same place all the
time) but not what I call them or, necessarily, the many command line
options that go with them.

Shell functions, by the way, are used to setup my shell environment
specific to a particular software project I'm working on.  So "cdt"
jumps me to the top of the project tree, "cdb" to where builds are run,
"cdx" to the top of the source (which may be different than the top of
the project", and so forth.  As an example, "mm" sets up my environment
so I can bounce around in and build the Minimyth source tree.  "xn" sets
me up to work out of my CVS tree for my XNotesPlus project.  Doing this
from a GUI would make no sense since the function only affects the
immediate shell, so the GUI shell would be affected but none of the
shells I open from it are.  The shell fucntions live in a shell script
that gets sourced by BASH when a new shell opens.  The reason I remember
these better than my shell scripts is that I use them directly more
often.

-- 
Michael J. Hammel                                    Senior Software Engineer
mjhammel at graphics-muse.org                           http://graphics-muse.org
------------------------------------------------------------------------------
Bumper Sticker: Jesus loves you... but everyone else thinks you are an asshole.




More information about the clue-tech mailing list