I have bash script which creates different users and password. The passwords and users are stored in variables.
cat << EOT
+---------------------------------------+
| Linux Logins |
+---------------+-----------------------+
| User | Password |
+---------------+-----------------------+
| $test | $testpw |
+---------------+-----------------------+
EOT
The Problem with this is that depending on the length of the stored variables the table gets messed up like this:
+---------------------------------------+
| Linux Logins |
+---------------+-----------------------+
| User | Password |
+---------------+-----------------------+
| michael | helolopk8712t76 |
+---------------+-----------------------+
This is because the tabs are hardcoded. How can I solve this in a different way? I know there is awk and column to do so. I want it dynamic as in mysql console if that is possible.