L04 – C Shell Scripting - Part 2 1. Control Structures: if ...
Geophysical Computing
L04-1
L04 ? C Shell Scripting - Part 2
1. Control Structures: if then else
Last time we worked on the basics of putting together a C Shell script. Now, it is time to add to this the control structures that actually make scripting useful.
The following example shows the three primary examples of how to test conditionally.
#!/bin/csh
echo "Enter a number between 1 and 10... " @ number = $<
if ($number == 6) then echo "that's the lucky number!"
endif
if ($number > 5 && $number < 7) then echo "that's the lucky number!"
else echo "you lose. try again."
endif
if ($number > 0 && $number < 5) then echo "a low pick."
else if ($number >= 7 && $number 0 && $number < 5) then echo "a low pick."
else if ($number >= 7 && $number ! file_list
# find out how many files I have @ nr = `awk `END {print NR}' file_list`
@ n = 1
# define a looping variable
# start the loop while ($n ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- identification history lmc truck
- experimental probability worksheet mrs cahall 7th grade
- basic concepts of probability theory part i
- random variables expectation and variance github pages
- random number generation c university of alaska system
- the guessing game
- chapter 4 loops southeastern louisiana university
- lattice point geometry pick s theorem kenyon college
- common commands in ansys apdl selecting stuff these
- ask a friend to pick a number from 1 through 1 000 after
Related searches
- tfm volume 1 part 2 chapter 4700
- riddle part 2 crossword clue
- 1 1 sqrt 2 1 sqrt 3
- ielts speaking part 2 pdf
- ielts speaking part 2 and 3 questions
- ielts speaking part 2 education
- ielts speaking part 2 art
- ielts speaking part 2 3
- ielts speaking part 2 structure
- ielts speaking part 2 answers
- shell scripting cheat sheet
- shell scripting examples