[Info-vax] Long uptime cut short by Hurricane Sandy

Paul Sture nospam at sture.ch
Sun Feb 3 08:58:06 EST 2013


In article <kell6u$udc$1 at dont-email.me>,
 Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:

> Here's a sequence that creates a script that uses cd to change the 
> default directory of the current process.
> 
> $ cat z.z
> #!/bin/bash
> cd ~/foo
> $ chmod o+x z.z
> $ alias foo=.\ ~/z.z
> $ foo

Thanks.  My first attempt (several years ago) to change directory using 
a script met with failure because scripts get their own process, which 
of course means the process you are typing in isn't affected.

> This sequence is similar to setting up a DCL foreign command for a 
> procedure, though with the added detail of making the script 
> executable.   In this case, this is also very close to the DCL command:
> 
> $ FOO :== SET DEFAULT yourloginroot:[foo]
> 
> You could also use
> 
> $ alias foo=source\ ~/z.z
> 
> in the above script, to make what's going on a little more verbose.
> 
> Yes, I do believe I've mentioned bash is cryptic.
> 
> The sethost script <http://labs.hoffmanlabs.com/node/1831> that I'd 
> mentioned in a recent post is an example of using a script to shorten 
> up common commands, too.

Another way for OS X users is to grab something like Automaton or 
TextExpander.  These aren't free, but they are certainly worth a test 
drive.

TextExpander is slick and there are good tutorials and online tips to 
take advantage of.

http://www.smilesoftware.com/TextExpander/screencast/index.html

Automaton is about half the price, and aiming to appeal to the budget 
conscious, adds file manipulation, a note taking app and a clipboard 
utility.  That comes at a price though, since the documentation is 
sparse, the config side of things locks up in certain circumstances (too 
often) and the (third party) video tutorials did a disappearing trick 
over the New Year.

http://www.tech.com.au/Site/Home.html

Both have time limited demos available, and there are other tools out 
there as well.  For file operations there's Hazel, and this is slick too:

http://www.noodlesoft.com/hazel.php

-- 
Paul Sture



More information about the Info-vax mailing list