Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Shells: User's Guide: HP 9000 Computers > Chapter 21 Basic Shell Programming

Creating and Executing Shell Scripts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Shell scripts are command lines that the shell executes in a group. The files .profile and .kshrc are examples of shell scripts.

To create a script, edit a file using an editor such as vi. If you don't know how to create a file using an editor, see The Ultimate Guide to the vi and ex Text Editors, or Using HP-UX. After you create the script, the file containing your command lines, you are ready to execute it.

First, make sure the file (script) is executable; type:

$ chmod +x script_name

This command changes file permissions on the new file so that it is executable. If you want more details on file permissions, see Using HP-UX. Then type the script_name (that is, the script filename):

$ script_name

and the script executes and prints out any output you specified.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-1991 Hewlett-Packard Development Company, L.P.