You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
declare -a files=(
"/usr/local/etc/php-fpm.d/php-fpm-pool.conf"
"/etc/nginx/conf.d/test.conf"
"/usr/local/etc/php/php.ini"
)
for file in "${files[@]}"; do
echo $file
done
Hashmaps
declare -A hash=(
[HDD]=Brand1
[Monitor]=Brand2
[Keyboard]=Brand3
)
for key in "${!hash[@]}"; do
echo $key;
done
Search and replace
name="NumberThreeNumberThree"
# All occurrences
filename="${name//Three/3}"
# First occurrence
filename="${name/Three/3}"
echo "$filename"
Heredoc
# Creating a .gitlab-ci.yml in current directory
cat <<EOF > .gitlab-ci.yml
image: busybox:latest
include:
- template: Security/Secret-Detection.gitlab-ci.yml
test:
stage: test
script:
- /bin/sh -c 'echo "Do nothing"'
EOF