You'll need to find out whether your version of UNIX understands the #! notation. This is a way to tell UNIX which interpreter (a shell, Perl, etc.) should read the commands in your file when you execute it (by typing its filename). If your UNIX doesn't recognize #!, you'll need to be sure that you know how to make it read shell scripts using the Bourne shell -- regardless of the shell you use interactively -- because the example shell scripts in this book all use the Bourne shell.
To test your system, let's make a two line file named testing.
NOTE: Do not make programs named test. There's an important system command named test, and your command might be used, accidentally, instead of the system program. Name your test programs testing, atest, whatever -- just not test.
#! /bin/echo just export stuff
% testing just testing (or just ./testing) %
% testing %
% testing #!: not found %
% testing export: Command not found. %
If your system ran the script with the C shell, find a way to make it use the Bourne shell instead. It's best to ask a local expert such as your system administrator.
[Table of Contents] [Index] [Previous: Using MH from Other Languages] [Next: Shell Command Substitution]
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.
Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>