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.
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. It 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 COPYING.
Copyright © 1991, 1992, 1995 O'Reilly Media, Inc.
Last modified: 2006-05-31 15:13:43 -0700