I am using paste command in the mail that I am sending using shell script. The output on the console looks perfect but the output in the mail is not in the same format. How do I make the format in the mail too same as in the console. The example below is just an example. The arrays values are dynamic. So I cannot use html table.
#!/bin/bash
BASETABLE[0]="ABC"
BASETABLE[1]="XYZ"
WORKFLOW[0]="123"
WORKFLOW[1]="789"
paste -d' ' <(printf "\n") <(printf "\n%-12.12s\n" "${BASETABLE[@]}") <(printf "\n%s\n" "${WORKFLOW[@]}")
echo "Test" `paste -d' ' <(printf "\n") <(printf "\n%-12.12s\n" "${BASETABLE[@]}") <(printf "\n%s\n" "${WORKFLOW[@]}")` | mail -s "Test" user@xyz.com
Outout on Console:
ABC 123
XYZ 789
Output in Mail:
ABC 123 XYZ 789