Writing/Executing a Simple Script

You can begin by creating a very simple Bourne shell script that prints a simple message such as Hello World and then exits.

Executing a “Hello World” script

1.
First, you need to start a text editor (such as vi) so you can key in your script in a text file using the vi text editor. Call this file testscript:
vi testscript
If vi is not your preferred text editor, you may use any available text editor to create testscript or any shell script.

Using a Word Processor to Create Your Script

It is common to find Windows systems and UNIX in the same network. You can use a Windows Word Processor to edit your script and then upload it to UNIX. Just make sure that you save your script as a simple text file in MSDOS mode ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.