To: webartery@yahoogroups.com
From: mez <netwurker@hotkey.net.au>
Date: Tue, 25 Feb 2003 10:07:13 +1100
Subject: resent from cream 12 newsletter

::::::::::::::_____________>


/usr/bin/bash as a performative tool    -       Alex Mclean


I'm writing this to share some thoughts with those already initiated with the
bash shell. Those otherwise interested might like to read this
(http://www.gnu.org/software/bash/bash.html) first. If any parts of this
article
are unclear or you have any questions, please email me (cream@slab.org) and
I'll
clarify.

I've probably spent more time at a bash prompt than I have in any other place
apart from bed. It's my primary computer interface; it's part of most of my
daily tasks and rituals. I do use a GUI windowing environment, but still find
myself typing far more than clicking.

So what do I perform with bash? I make music with self-written Perl scripts,
that synchronise, play sounds and control synthesis parameters via a central
server. Some of these scripts are interactive and some aren't, and so a great
deal of the performance is controlled from the command line, starting sets of
scripts with particular parameters and then choosing the right moment to kill
them.

Typing long, textual commands seems like a slow and inexpressive way to make
live music. However I find this much faster than using a mouse, and more
expressive than using a guitar; but then, I'm a fast typist and am not much
good
at playing the guitar. I also know a few handy bash shortcuts...

So lets cut to the meat. Here's how I use the bash prompt.


^n ^p ^b ^f ^a ^e

These are navigation control keys, in fact the first four are simple aliases
for the arrow keys; down, up, left and right respectively. These are keys I
need
all the time but are located far away from the 'home keys'. You only save a
fraction of a second by hitting ^b rather than left-arrow, but in my opinion
shaving all these fractions is what turns you into a bash prompt maestro.


^r

Control and r is perhaps my most used performative expression. It lets you
do a
reverse search through your entire command history. So if I want to find a
command I ran at a gig a couple of weeks or months ago, I can, with a few
key-presses. This is great, because I have no memory of my own.

There's a problem with this; you might accidentally re-run that dodgy 'rm -rf
.' command and delete all your files. You can pop the following HISTIGNORE
environment variable in your .bash_profile to stop this from happening, and
while you're there, why not drop in a HISTSIZE variable to keep your
history for
longer:

HISTIGNORE="rm *"
HISTSIZE="2048"
export HISTIGNORE HISTSIZE


tab completion

Another shell shortcut under-used by many; tab completion! Most know that when
you type the first few characters of a command, file or directory name and
then
press tab, the shell fills in the rest of the for you. But! It doesn't just
apply to filenames... Bash now has 'programmable completion', meaning that it
will now complete hostnames, process names, usernames, etc, etc... Download a
config file from here (http://www.caliban.org/bash/index.shtml#completion) and
weep with joy!


the last bit

Well, those are the most important bash keystrokes I use. When performing I
tend to end up with a lot of processes all over a mess of xterms, all with
various processes running in the background. So I end up using 'ps -wux' and
'kill' a lot to list and kill my processes. People seem to enjoy watching me
scrabble around, flicking through xterms running obtuse homemade curses
interfaces. Hopefully it's not too distracting everyone from the music
itself...

Although it tends to come as default with Linux based systems, 'bash' is by no
means the only Unix shell. For example 'zsh' is well loved among its loyal fan
base. So have a look around, but whatever shell you opt for and whatever Unix
art you are creating, check out the man pages and you might find some
wonderful
shortcuts to command prompt heaven.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==--=-=-=-=-=-=-=-=-==-==-=-=-=
alex mclean is a member of the state51 conspiracy
(http://state51.co.uk), one half of the technopop combo slub
(http://slub.org) and founder of the slaboratory (http://slab.org).
-=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
 
.           .    ....         .....

www.cddc.vt.edu/host/netwurker/

.... .               .???  .......


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




Back to nettime unstable digest vol 36