# read global startup file if it exists in Objective-C Assign code128b in Objective-C # read global startup file if it exists

# read global startup file if it exists use iphone code128b generation toreceive ansi/aim code 128 on objective-c Basice Features of 2D QR Codes # # # # # #. prevent overwriting files tu rn off "you have new mail" notice set LANG variable set vim options set up aliases always do interactive rm"s. # a function to exchange the names # of two files . (Dot) or source: Runs a Startup File in the Current Shell After you edit a startup fil iPhone USS Code 128 e such as .bashrc, you do not have to log out and log in again to put the changes into effect. Instead, you can run the startup file using the .

(dot) or source builtin (they are the same command under bash; only source is available under tcsh [page 390]). As with all other commands, the . must be followed by a SPACE on the command line.

Using . or source is similar to running a shell script, except these commands run the script as part of the current process. Consequently, when you use .

or source to run a script, changes you make to variables from within the script affect the shell you run the script from. If you ran a startup file as a regular shell script and did not use the . or source builtin, the variables created in the startup file would remain in effect only in the subshell running the script not in the shell you ran the script from.

You can use the . or source command to run any shell script not just a startup file but undesirable side effects (such as changes in the values of shell variables you rely on) may occur. For more information refer to Locality of Variables on page 436.

In the following example, .bashrc sets several variables and sets PS1, the prompt, to the name of the host. The .

builtin puts the new values into effect.. $ cat ~/.bashrc export TERM= vt100 # set export PS1="$(hostname -f): " # set export CDPATH=:$HOME # add stty kill "^u" # set $ . ~/.

bashrc the terminal type the prompt string HOME to CDPATH string kill line to control-u.

Shell Basics 275 Commands That Are Symbols The Bourne Again Shell uses iPhone code 128b the symbols (, ), [, ], and $ in a variety of ways. To minimize confusion, Table 8-1 lists the most common use of each of these symbols, even though some of them are not introduced until later in this book..

Table 8-1. Symbol () $( ) (( )) $(( )) [] [[ ]]. Builtin commands that are symbols Command Subshell (page 284) Command substitution (page 340) Arithmetic evaluation; a synonym for let (use when the enclosed value contains an equal sign; page 460) Arithmetic expansion (not for use with an enclosed equal sign; page 338) The test command (pages 399, 401, and 854) Conditional expression; similar to [ ] but adds string comparisons (page 461). Redirecting Standard Error 5 covered the concept of st andard output and explained how to redirect standard output of a command. In addition to standard output, commands can send output to standard error. A command can send error messages to standard error to keep them from getting mixed up with the information it sends to standard output.

Just as it does with standard output, by default the shell directs standard error to the screen. Unless you redirect one or the other, you may not know the difference between the output a command sends to standard output and the output it sends to standard error. This section describes the syntax used by the Bourne Again Shell to redirect standard error and to distinguish between standard output and standard error.

See page 359 if you are using the TC Shell.. File descriptors A file descriptor is the pla ce a program sends its output to and gets its input from. When you execute a program, Linux opens three file descriptors for the program: 0 (standard input), 1 (standard output), and 2 (standard error). The redirect output symbol (> [page 126]) is shorthand for 1>, which tells the shell to redirect standard output.

Similarly < (page 128) is short for 0<, which redirects standard input. The symbols 2> redirect standard error. For more information refer to File Descriptors on page 431.

The following examples demonstrate how to redirect standard output and standard error to different files and to the same file. When you run the cat utility with the name of a file that does not exist and the name of a file that does exist, cat sends an error message to standard error and copies the file that does exist to standard output. Unless you redirect them, both messages appear on the screen.

Copyright © . All rights reserved.