|
Fedora™ Unleashed, 2008 editionFor example, if you want to use the want command, your first inclination might be to write the following: #!/usr/local/bin/wish Although this works on many other operating systems, the script fails under Linux because want is located under the /usr/bin directory. However, if you write the command line this way #!/bin/sh exec wish "$@" the script always finds the correct binary. Using Variables in Shell Scripts When writing shell scripts for Linux, you work with three types of variables: в–єВ Environment variables — Part of the system environment, you can use them in your shell program. New variables can be defined, and some of them, such as PATH, can also be modified within a shell program. в–єВ Built-in variables — These variables, such as options used on the command (interpreted by the shell as a positional argument), are provided by Linux. Unlike environment variables, you cannot modify them. в–єВ User variables — Defined by you when you write a shell script. You can use and modify them at will within the shell program ...» |
Код для вставки книги в блог HTML
phpBB
текст
|
|