Presentation is loading. Please wait.

Presentation is loading. Please wait.

Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 10 Dr. Jerry Shiao, Silicon Valley University.

Similar presentations


Presentation on theme: "Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 10 Dr. Jerry Shiao, Silicon Valley University."— Presentation transcript:

1 Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 10 Dr. Jerry Shiao, Silicon Valley University

2 SILICON VALLEY UNIVERSITY CONFIDENTIAL 2 Summer 2015 Introduction UNIX/Linux Course Section 10 Bourne Shell Programming  Bourne Shell: More than Command Interpreter Programming Language used to perform tasks that cannot be performed by one or sequence of commands. Nonsequential execution of commands (if, then, elif, else). Repeated execution of commands (for, while, until).  Running Bourne Shell Script  Shell Variables Reading and Writing Shell Variables Command Substitution Exporting Environment Resetting Variables Creating Read-Only User-Defined Variables Reading From Standard Input  Passing Arguments to Shell Scripts

3 SILICON VALLEY UNIVERSITY CONFIDENTIAL 3 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Shells are Command Interpreter. Shells also can execute scripts (UNIX file) consisting of shell commands and program control flows.  Program Control Flows: allow nonsequential execution of commands in a shell script and repeated execution of block of commands.  Similar to C programming language. Shell Variables:  Read/Write storage place used as temporary storage when executing shell script.

4 SILICON VALLEY UNIVERSITY CONFIDENTIAL 4 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Execution of a Bourne Shell:  Add execute permission to access permission for file. $ chmod u+x script_file $ script_file  Execute the script file as parameter to bash shell. $ /bin/sh script_file  Specify the shell in the script file. File: script_file #!/bin/sh Current shell executing the file finds “#!” as the first line, the rest of the line is the absolute path for the shell to be used to execute the file. NOTE: For C shell, use “:” instead of “#!”. C shell will use Bourne shell.

5 SILICON VALLEY UNIVERSITY CONFIDENTIAL 5 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Shell Variables  Main memory location that is given a name.  Name: First character is letter or underscore. Name has digits, letters, and underscore.  Value: Always string of characters Shell Environment Variables  Customize environment of the current shell and subshells.  Set by System Administrator or user to create common environment for all users.  Login Session: ~/.bash_profile or ~/.profile  Non-login Session: ~/.bashrc User-Defined Variables  Temporary value used in the current shell whose values change when shell executes.

6 SILICON VALLEY UNIVERSITY CONFIDENTIAL 6 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Writeable Bourne Shell Environment Variable.

7 SILICON VALLEY UNIVERSITY CONFIDENTIAL 7 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Read-Only Shell Variables  Command Line Arguments (parameters passed to a shell script at the command line).

8 SILICON VALLEY UNIVERSITY CONFIDENTIAL 8 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming “set” Command Displays all Shell Variables.  Displays Environment and User-Defined Variables $ set BASH=/bin/bash BASH_VERSION='4.1.7(1)-release' DISPLAY=:0.0 PS1='\u@\h:\w> ‘ HOME=/home/sau “env” Command Displays all Shell Variables.  Display the Environment Variables $ env HOME=/home/sau HOSTNAME=buildbed-vm MAIL=/var/spool/mail/sau PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/u sr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin

9 SILICON VALLEY UNIVERSITY CONFIDENTIAL 9 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Reading/Writing Shell Variables variable1=value1 [variable2=value2 …]  NO space before or after “=“ character.  Value containing spaces require quotes. (“) Double quotes : Variable substitution but metacharacters are treated literally. (‘) Single quotes: Whole string is treated literally. $variable  Variable substitution and the value of variable is executed as shell command. $ command=pwd $ $command /home/sau/class

10 SILICON VALLEY UNIVERSITY CONFIDENTIAL 10 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming $ name=John $ echo $name John $ name=John Doe Doe: not found $ name=”John Doe” $ echo $name John Doe $ name=John* $ echo $name John.Bates.letter John.Johnsen.memo John.email $ echo “$name” John* $ echo “The name $name sounds familiar!” The name John* sounds familiar! $ echo \$name $name $ echo ‘$name’ $name $ Shell variable assignment. “$” returns current value of shell variable. No space allowed between shell variable, “=“, and value. The word “Doe” is interpretted as shell command. Use quotes (“) to include space in the value. Without quotes, the asterisk (*) is processed as a metacharacter. Use quotes (“) to show the value, but does not interpret the metacharacters. Use “\” as escape character. Use single quote (‘) to process whole string literally.

11 SILICON VALLEY UNIVERSITY CONFIDENTIAL 11 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Command Substitution `command`  Command enclosed in back quotes (`) will be executed by the shell and substitutes the output of the command with the command (including back quotes). $ command=pwd $ echo "The value of command is : $command." The value of command is : pwd. $ command=`pwd` $ echo "The value of command is : $command." The value of command is : /home/sau/class4. $ ~/class4> echo "The data and time is `date`." The data and time is Fri Nov 30 02:27:56 PST 2012.

12 SILICON VALLEY UNIVERSITY CONFIDENTIAL 12 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Exporting Environment  Environment variable ONLY known to local Shell environment.  Shell script executed in local Shell environment does not get access to calling shell’s environment variables. Export [ name-list ]  Export the names and pass the value of one or more variables to any command, Shell script, subsequent shell and subshell executed from the local Shell environment.  Exported variable has a copy of the variable’s value in the called Shell script or subshell. Exported variable cannot be changed in the called Shell script or subshell. The calling Shell script variable remains the same.

13 SILICON VALLEY UNIVERSITY CONFIDENTIAL 13 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Script file display_name has shell variable “name”. The calling Shell evironment also has shell variable “name”, but since it was not exported, the called script file, “display_name” does NOT get the value from the calling Shell environment. The calling Shell evironment exports the shell variable “name”. The called script file, “display_name” does get the value from the calling Shell environment and displays it. The calling Shell environment echos “$?”, readonly Shell environment variable.

14 SILICON VALLEY UNIVERSITY CONFIDENTIAL 14 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming $ cat export_demo #!/bin/sh name="John Doe" export name./display_change_name./display_name exit 0 $ cat display_change_name #!/bin/sh echo $name name="Plain Jane" echo $name./display_name exit 0 $./export_demo John Doe Plain Jane John Doe $ Script file “export_demo” will call script file “display_change_name” and “display_name” with exported Shell variable, “name”. The script file “display_change_name” will change the value of the variable exported from calling script file, “name”. Calls script file “display_name” with changed value. The changed value is changed for the subsequent Shell script. The calling script file, “export_demo”, exported Shell variable does not change.

15 SILICON VALLEY UNIVERSITY CONFIDENTIAL 15 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Resetting Variables unset [ name-list ]  Reset or remove the variable or function corresponding to the names in the ‘name-list’, where ‘name-list’ is a list of names separated by spaces. variable=  Assigns the variable to NULL value.

16 SILICON VALLEY UNIVERSITY CONFIDENTIAL 16 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Read-Only Defined Variables readonly [ name-list ]  Prevent assignment of new values to the variables in “name-list”.  “readonly” displaces ALL read-only variables.  $ name=Jim  $ place=Ames  $ echo "$name $place"  Jim Ames  $ readonly name place  $ name=ART place="Ann Arbor"  bash: name: readonly variable  $ readonly  declare -ir EUID="1001"  declare -ir PPID="5228“  declare -ir UID="1001"  declare -r name="Jim"  declare -r place="Ames" Assigning value to readonly Shell variable returns error. “readonly” displays all read-only Shell variables.

17 SILICON VALLEY UNIVERSITY CONFIDENTIAL 17 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Reading from Standard Input  read variable-list  Read one line from standard input and assign words in the line to variables in “name-list”

18 SILICON VALLEY UNIVERSITY CONFIDENTIAL 18 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Special Characters for the echo Command

19 SILICON VALLEY UNIVERSITY CONFIDENTIAL 19 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Passing Arguments to Shell Scripts First nine of the command line arguments or positional parameters are:  $1 through $9  Set to NULL if positional variable is not passed an argument $# : Total number of arguments passed to the script. $* : Contains values of all the arguments. $@ : Contains values of all the arguments and the arguments are in quotes if used as “$@”. $0 : Contains the name of the script file.

20 SILICON VALLEY UNIVERSITY CONFIDENTIAL 20 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Passing Arguments to Shell Scripts $ cat cmdargs_demo #!/bin/sh echo “The command name is: $0.” echo “The number of command line arguments passed as parameters are $#.” echo “The value of the command line arguments are: $1 $2 $3 $4 $5 $6 $7 $8 $9.” echo “Another way to display values of all of the arguments: $@.” echo “Yet another way is: $*.” exit 0 $ cmdargs_demo a b c d e f g h I The command name is: cmdargs_demo. The number of command line arguments passed as parameters are 9. The value of the command line arguments are: a b c d e f g h i. Another way to display values of all of the arguments: a b c d e f g h i. Yet another way is: a b c d e f g h i. $ cmdargs_demo One Two 3 Four 5 6 The command name is: cmdargs_demo. The number of command line arguments passed as parameters are 6. The value of the command line arguments are: One Two 3 Four 5 6. Another way to display values of all of the arguments: One Two 3 Four 5 6. Yet another way is: One Two 3 Four 5 6. $ Display name of the script file. Display number of arguments.

21 SILICON VALLEY UNIVERSITY CONFIDENTIAL 21 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Passing Arguments to Shell Scripts Set [ options ] [ argument-list ]  Set values of the positional arguments (i.e. $1, $2, etc) to the arguments in “argument-list”.  When executed without an argument, the set command displays names of all shell variables and their current values.  Options: -v = Verbose -n = noexec  set `date`  Sat Dec 1 00:28:45 PST 2012 $1 $2 $3 $4 $5 $6 $ date Sat Dec 1 00:28:45 PST 2012 $ set `date` $ echo "$@" Sat Dec 1 00:28:51 PST 2012 $ echo $2 $3, $6 Dec 1, 2012

22 SILICON VALLEY UNIVERSITY CONFIDENTIAL 22 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Passing Arguments to Shell Scripts shift [ N ]  Shift the command line arguments N positions to the left.  Once shifted, the argument cannot be recovered.  set `date`  Sat Dec 1 00:39:44 PST 2012 $1 $2 $3 $4 $5 $6 $ date Sat Dec 1 00:39:35 PST 2012 $ set `date` $ echo $@ Sat Dec 1 00:39:44 PST 2012 $ echo $1 $2 $3 $4 Sat Dec 1 00:39:44 $ shift 2 $ echo $1 $2 $3 $4 1 00:39:44 PST 2012 $

23 SILICON VALLEY UNIVERSITY CONFIDENTIAL 23 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming $ cat shift_demo #!/bin/sh echo “The program name is $0.” echo “The arguments are: $@” echo “The first three arguments are: $1 $2 $3” shift echo “The program name is $0.” echo “The arguments are: $@” echo “The first three arguments are: $1 $2 $3” shift 3 echo “The program name is $0.” echo “The arguments are: $@” echo “The first three arguments are: $1 $2 $3” exit 0 $ shift_demo 1 2 3 4 5 6 7 8 9 10 11 12 The program name is shift_demo. The arguments are: 1 2 3 4 5 6 7 8 9 10 11 12 The first three arguments are: 1 2 3 The program name is shift_demo. The arguments are: 2 3 4 5 6 7 8 9 10 11 12 The first three arguments are: 2 3 4 The program name is shift_demo. The arguments are: 5 6 7 8 9 10 11 12 The first three arguments are: 5 6 7 $ Shift positional arguments 1 argument to the left. Shit positional arguments 3 arguments to the left.

24 SILICON VALLEY UNIVERSITY CONFIDENTIAL 24 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Passing Arguments to Shell Scripts $ cat set_demo #!/bin/sh filename="$1" set `ls -il $filename` inode="$1" size="$6" echo "Name\tInode\tSize" echo echo "$filename\t$inode\t$size" exit 0 $ ls -il mydata 2630053 -rw-r--r-- 1 sau users 63 2012-11-02 02:39 mydata $./set_demo mydata Name Inode Size Mydata 2630053 63 $ Set values of the positional argument with command substitution (`). Overwrites previous $0 - $9. $1 $6

25 SILICON VALLEY UNIVERSITY CONFIDENTIAL 25 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Bourne Shell Programming Comments and Program Headers  Comments in Shell scripts to describe the purpose of a particular set of commands. Similar to putting comments in program code.  Program header for Shell scripts: Name of the file containing the Shell script. Name of the author. Date written. Date last modified. Purpose of the script ( in one or two lines ). A brief description of the algorithm used to implement the solution to the problem at hand.  Use “#” to start a comment line. Comment line does not have to start at the beginning of the line. For example, the comment line could follow the command.

26 SILICON VALLEY UNIVERSITY CONFIDENTIAL 26 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Comments and Program Headers Kernel Script File: #!/bin/bash SCRIPT_VERSION=0.4.58 ####################################################################### #Copyright (C) 2007 Free Software Foundation. #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 2 of the License, or #(at your option) any later version. … ####################################################################### #The script was written for 2 main reasons: # 1. Remove the need for the devs/helpers to ask several questions before we can easily help the user. # 2. Allow newer/inexperienced ALSA users to give us all the info we need to help them. …

27 SILICON VALLEY UNIVERSITY CONFIDENTIAL 27 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands  Used to determine the sequence in which statements in a Shell script execute. There are three basic types of statements for controlling flow of a script. -- Two-way Branching : if statement -- Multiway Branching : if statement and case statement -- Repetitive execution of one or more commands. for, while, and until statement

28 SILICON VALLEY UNIVERSITY CONFIDENTIAL 28 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Two-way Branching: Using if and then statements “expression” is a condition or evaluation using “test” command that will return a true or false.  True: “then-commands” is executed.  One space required before/after an operator, a parenthesis, bracket, or operand.

29 SILICON VALLEY UNIVERSITY CONFIDENTIAL 29 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Two-way Branching:

30 SILICON VALLEY UNIVERSITY CONFIDENTIAL 30 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Two-way Branching: Using if / then / else statements  “if” “expression” is true, the commands in “then-command” is executed.  “if” “expression” is false, the commands in “else-command” is executed.  “fi” terminates the two-way branching.

31 SILICON VALLEY UNIVERSITY CONFIDENTIAL 31 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Two-way Branching:

32 SILICON VALLEY UNIVERSITY CONFIDENTIAL 32 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Multi-way Branching: Using if / then / elif / else statements  “if” “expression” is true, the commands in “then-command” is executed OR “elif: “expression” is true,  “if” or “elif” “expression” is false, the commands in “else-command” is executed.  “fi” terminates the two-way branching. if expression then [elif expression then then-command-list ]... [else else-command-list ] fi if expression1 then then-commands elif expression2 elif1-commands elif expression3 elif2-commands... else else-command fi

33 SILICON VALLEY UNIVERSITY CONFIDENTIAL 33 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Multi-way Branching: Using if / then / elif / else statements

34 SILICON VALLEY UNIVERSITY CONFIDENTIAL 34 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Operators for the “test” Command

35 SILICON VALLEY UNIVERSITY CONFIDENTIAL 35 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Using “if”, “then”, and “test” expression. $1: Parameter 1. $# : Total command line arguments. $0: Name of program. $?: Exit status. -gt: a > b? -eq: a equal b? -d: file is directory? -f: ordinary file?

36 SILICON VALLEY UNIVERSITY CONFIDENTIAL 36 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Using “if”, then”, and “expression” as conditional. $1: Parameter 1. $# : Total command line arguments. $0: Name of program. $?: Exit status. -gt: a > b? -eq: a equal b? -d: file is directory? -f: ordinary file?

37 SILICON VALLEY UNIVERSITY CONFIDENTIAL 37 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Using “if”, then”, and “elif” as conditional. $1: Parameter 1. $# : Total command line arguments. $0: Name of program. $?: Exit status. -eq: a equal b? -d: file is directory? -f: ordinary file?

38 SILICON VALLEY UNIVERSITY CONFIDENTIAL 38 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The for Statement  Used for repetitive execution of a block of commands in shell script.  Assign each word in “argument-list” to “variable” in turn and execute “command-list”. If “argument-list” is ommitted, $@ (values of all command line arguments) is assumed.

39 SILICON VALLEY UNIVERSITY CONFIDENTIAL 39 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The for Statement Variable “people” is assigned words in “argument-list” one by one. Variable people is echoed.

40 SILICON VALLEY UNIVERSITY CONFIDENTIAL 40 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The for Statement for variable [in arg-list]: Since arg- list is NULL, $@ (values of all command line arguments) is assumed. $?: Exit status of most recent command. Once $user found, in /etc/passwd, display fifth column.

41 SILICON VALLEY UNIVERSITY CONFIDENTIAL 41 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The while Statement  Repeated execution of a block of commands based on the condition of an expression. Continue executing “command-list” as long as “expression” evaluates to TRUE.

42 SILICON VALLEY UNIVERSITY CONFIDENTIAL 42 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands $ cat while_demo #!/bin/sh secretcode=agent007 echo “Guess the code!” echo “Enter your guess: \c” read yourguess while [ “$secretcode” != “$yourguess” ] Do echo “Good guess but wrong. Try again!” echo “Enter your guess: \c” read yourguess Done echo “Wow! You are a genius!!” exit 0 $ while_demo Guess the code! Enter your guess: star wars Good guess but wrong. Try again! Enter your guess: columbo Good guess but wrong. Try again! Enter your guess: agent007 Wow! You are a genius!! $ Expression evaluates TRUE, continue execution. Expression evaluates FALSE, exit.

43 SILICON VALLEY UNIVERSITY CONFIDENTIAL 43 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The until Statement  Repeated execution of a block of commands based on the condition of an expression. Continue executing “command-list” as long as “expression” evaluates to FALSE.

44 SILICON VALLEY UNIVERSITY CONFIDENTIAL 44 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands Expression evaluates FALSE, continue execution. Expression evaluates TRUE, exit.

45 SILICON VALLEY UNIVERSITY CONFIDENTIAL 45 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The break and continue Statements  Interrupt Sequential Execution of loop in a script

46 SILICON VALLEY UNIVERSITY CONFIDENTIAL 46 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The case Statement  Multiway branching similar to nested if statements.  Use when elifs exceeds 3 levels.  Compares value in “test-string” with values of all patterns.  “ ; ; “ delimits “command-list”, otherwise fall-through.  Default pattern is “ * ) ”, wild card pattern to handle exception (error) condition.

47 SILICON VALLEY UNIVERSITY CONFIDENTIAL 47 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The case Statement

48 SILICON VALLEY UNIVERSITY CONFIDENTIAL 48 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The case Statement Case statement matches “option” with four patterns (upper or lower case). Default is the wild card pattern.

49 SILICON VALLEY UNIVERSITY CONFIDENTIAL 49 Copyright @2005 Pearson Addison-Wesley Introduction UNIX/Linux Course Section 10 Bourne Shell Programming Program Control Flow Commands The case Statement Case statement does not match patterns, but execution caught by “default” wild card pattern.


Download ppt "Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 10 Dr. Jerry Shiao, Silicon Valley University."

Similar presentations


Ads by Google