Bash

Multi Dimensional Arrays

#!/bin/bash
declare -A identification0=(
    [email]='test@abc.com'
    [password]='admin123'
)
declare -A identification1=(
    [email]='test@xyz.org'
    [password]='passwd1!'
)
 
declare -n identification
for identification in ${!identification@}; do
    echo "Email: ${identification[email]}"
    echo "Password: ${identification[password]}"
done

Ping without Ping

You can test port connectivity without using the ping command. Useful if you have to troubleshoot someting on a stripped down Docker image.

$ echo > /dev/tcp/HOST/PORT
$ echo $?
0
$ echo > /dev/tcp/HOST/PORT
bash: connect: Connection timed out
$ echo $?
1