gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sh.el -- "tutorial" on shell scripting through elisp..


From: D Goel
Subject: sh.el -- "tutorial" on shell scripting through elisp..
Date: Wed, 12 Jan 2005 21:11:01 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

The main attached file is 'example-emacs-script', but I named the
subject sh.el to conform to the elisp posting guidelines.  More
description appears here: 

 http://www.emacswiki.org/cgi-bin/wiki/CategoryBatchMode

As I teach my novice self about the many issues encountered during
scripting through elisp, (with lots of help from #emacsers), I decided
to write it into a tutorial-script.  Imrovements are welcome.

In particular, if active developers are reading this, we'd like to
point out that (princ) and (prin1) in batch-mode prints to stdout, as
opposed to stderr, which is not what the elisp manual says.  On the
other hand, that is the only way at this time (we think) that you can
write to stdout through an emacs batch script, so we hope that this
"bug" is not fixed, but retained as a feature.



With the current Emacs CVS, you can write emacs scripts just as if you
were writing bash scripts, if you include this at the top of your
script file:

#!/usr/local/bin.../emacs --script



====================================================


With emacs, you can take care of all things bash, like stderr, stdout,
return code, etc. This example script demonstrates all the things
you'd want to do with emacs scripts, and is meant to serve as a
tutorial (I am teaching myself too!).  Save these files somewhere in
your bash path, change the path in example-emacs-script to that path,
and to see the "tutorial", type example-emacs-script on your bash
prompt.

Improvements are most welcome. 


* http://gnufans.net/~deego/pub/usr/local/scripts/example-emacs-script
* http://gnufans.net/~deego/pub/usr/local/scripts/sh.el
* http://gnufans.net/~deego/pub/usr/local/scripts/sh-example-emacs-script.el



The files are attached here. 

DG                                 http://gnufans.net/
--

Attachment: example-emacs-script
Description: Binary data

Attachment: sh.el
Description: application/emacs-lisp

Attachment: sh-example-emacs-script.el
Description: application/emacs-lisp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]