Move under www to ease rsync
This commit is contained in:
32
www/eps/hpr2739/hpr2739_bash19_ex1.sh
Executable file
32
www/eps/hpr2739/hpr2739_bash19_ex1.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Example 1 for Bash Tips show 19: how an integer array works
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Declare an integer array and a normal one
|
||||
#
|
||||
declare -a -i ints
|
||||
declare -a norm
|
||||
|
||||
#
|
||||
# Load both with arithmetic expressions
|
||||
#
|
||||
ints=('38 % 7' '38 / 7')
|
||||
norm=('38 % 7' '38 / 7')
|
||||
|
||||
#
|
||||
# Try storing a string in each of the arrays
|
||||
#
|
||||
ints+=('jellyfish')
|
||||
norm+=('jellyfish')
|
||||
|
||||
#
|
||||
# Show the results
|
||||
#
|
||||
echo "ints: ${ints[*]}"
|
||||
echo "norm: ${norm[*]}"
|
||||
|
||||
|
||||
exit
|
||||
Reference in New Issue
Block a user