Redirecting Command Events - Novell LINUX ENTERPRISE DESKTOP 11 - ADMINISTRATION GUIDE 17-03-2009 Administration Manual

Hide thumbs Also See for LINUX ENTERPRISE DESKTOP 11 - ADMINISTRATION GUIDE 17-03-2009:
Table of Contents

Advertisement

3. The script needs executable permissions. Set the permissions with the following
command:
chmod +x ~/bin/hello.sh
If you have fullfilled all of the above prerequisites, you can execute the script with either
~/bin/hello.sh or hello.sh. The first call uses an absolute path whereas the
second one searches for the command in each directory given by the PATH environment
variable.

7.3 Redirecting Command Events

Each command can use three channels, either for input or output:
• Standard Output
prints something, it uses the standard output channel.
• Standard Input
uses this channel.
• Standard Error
To redirect these channels, there are the following possibilities:
Command > File
Saves the output of the command into a file, an existing file will be deleted. For
example, the ls command writes its output into the file listing.txt:
ls > listing.txt
Command >> File
Appends the output of the command to a file. For example, the ls command ap-
pends its output to the file listing.txt:
ls >> listing.txt
Command < File
Reads the file as input for the given command. For example, the read command
reads in the content of the file into a variable:
read a < foo
64
Administration Guide
This is the default output channel. Whenever a command
If a command needs input from users or other commands, it
Commands use this channel for error reporting.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LINUX ENTERPRISE DESKTOP 11 - ADMINISTRATION GUIDE 17-03-2009 and is the answer not in the manual?

This manual is also suitable for:

Suse linux enterprise desktop 11

Table of Contents