langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
10
Task/Arrays/UNIX-Shell/arrays-6.sh
Normal file
10
Task/Arrays/UNIX-Shell/arrays-6.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# shell function to append values to an array
|
||||
# push LIST VALUES ...
|
||||
push() {
|
||||
local var=${1:?'Missing variable name!'}
|
||||
shift
|
||||
eval "\$$var=( \"\${$var[@]}\" \"$@\" )"
|
||||
}
|
||||
|
||||
push alist "one thing to add"
|
||||
push alist many words to add
|
||||
Loading…
Add table
Add a link
Reference in a new issue