Move under www to ease rsync
This commit is contained in:
24
www/eps/hpr2739/hpr2739_bash19_ex3.sh
Executable file
24
www/eps/hpr2739/hpr2739_bash19_ex3.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Example 3 for Bash Tips show 19: using 'read' to fill an array
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Create an indexed array
|
||||
#
|
||||
declare -a readtest
|
||||
|
||||
#
|
||||
# Populate it with space separated words on one line using 'echo -n' to force
|
||||
# that to happen
|
||||
#
|
||||
read -r -a readtest < <(for c in {A..J}{1..3}; do echo -n "$c "; done)
|
||||
|
||||
#
|
||||
# The result
|
||||
#
|
||||
echo "readtest: ${#readtest[*]} elements"
|
||||
echo "readtest: ${readtest[*]}"
|
||||
|
||||
exit
|
||||
Reference in New Issue
Block a user