Yahoo web hosting - How It WorksThis script creates the variable salutation,
How It WorksThis script creates the variable salutation, displays its contents, and then shows how various parame- ter variables and the environment variable $HOMEalready exist and have appropriate values. We ll return to parameter substitution in more detail later in the chapter. ConditionsFundamental to all programming languages is the ability to test conditions and perform different actionsbased on those decisions. Before we talk about that, though, we ll look at the conditional constructs thatwe can use in shell scripts and then look at the control structures that use them. Ashell script can test the exit code of any command that can be invoked from the command line, includ- ing the scripts that you have written yourself. That s why it s important to always include an exitcom- mand at the end of any scripts that you write. The test,or [,CommandIn practice, most scripts make extensive use of the [or testcommand, the shell s Boolean check. On mostsystems, the [and testcommands are synonymous, except that when the [command is used, a trailing]is also used just for readability. Having a [command might seem a little odd, but within the code itdoes make the syntax of commands look simple, neat, and more like other programming languages. # ls -l /usr/bin/[ lrwxrwxrwx 1 root root 4 Oct 13 10:46 /usr/bin/[ -> testWe ll introduce the testcommand using one of the simplest conditions: checking to see if a file exists. The command for this is test -f
Note: If you are looking for cheap webhost to host and run your apache application check Vision apache web hosting services