Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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