Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://wiki.bash-hackers.org/syntax/pe
- https://www.tldp.org/LDP/abs/html/parameter-substitution.html
- The simplest way to copy a non-associative array in bash is to:
- arrayClone=("${oldArray[@]}")
- AAA=( $(git branch -a) )
- AAA=( "${AAA[@]//remotes\/origin\/}" )
- # split string on spaces, result is an array
- p=( ${package_file//-/ } )
- shopt -s extglob
- A=aaaaXXaaa; echo "${A//+([^A-Z])/=}"
- =XX=
- A=aaaaXXaaa; echo "${A//+([A-Z])/=}"
- aaaa=aaa
- A=aaaa//aaa; echo "${A//+(\/)/=}"
- aaaa=aaa
- **************************************************
- CMD=( python3 somescript.py -r -d "$DAYS" )
- if test -n "${EXTRA_PARAMS-}"; then
- IFS=" " read -r -a arr <<< "$EXTRA_PARAMS"
- CMD+=( "${arr[@]}" );
- fi
- # executing python script
- "${CMD[@]}"
- **************************************************
Add Comment
Please, Sign In to add comment