Nota: this will work simply while each file do contain 1 word by line.
And if you plan to use space in your source files, you could use another delimiter:
while IFS=@ read -r aws_user_name aws_key aws_account_num ;do
printf "User: %-16s Key: %-22s AccNum: %s\n" \
"$aws_user_name" "$aws_key" "$aws_account_num"
# ....
done < <(
paste -d@ "$aws_users_all" "$aws_env_list" "$aws_account_numbers"
)
I am not sure IFS=@
paste -d@
mean?
I understand paste -d "|,"
, I can aslo figure it out IFS=";" mean.
I also following https://stackoverflow.com/questions/7427262/how-to-read-a-file-into-a-variable-in-shell
https://man7.org/linux/man-pages/man1/bash.1.html
paste
implementations including GNUpaste
don't support multibyte ones (and some shells, not bash, don't support them in IFS either), and non-white space ones because the whitespace ones receive a special treatment when it comes to$IFS
splitting. So@
is a good choice because it's single byte and non whitespace (and presumably cannot occur in the data) butpaste
's default delimiter (TAB) would be a poor choice. – Stéphane Chazelas Dec 24 '21 at 11:35$IFS
(withIFS=$'\t\t'
, you would be able to use the defaultpaste
delimiter there). – Stéphane Chazelas Dec 24 '21 at 14:20