I am not so familiar with bash scripting. I want to echo each line with the proper format role path=...
but this for loop does not allow me to do so. It basically prints all in once not go line by line prints. But interestingly when I run vault list database/roles
command I am able to see all roles line by line.
How can I resolve this problem?
Code:
for path in $(vault list database/roles);
do
echo role path=${path};
done
Output:
role path=Keys
----
Role-1
Role-2
Role-3
Role-4
Role-5
P.S.: I need to keep everything in the loop as I am going to run this command later on: vault delete database/roles/${path}
Updated: Output for vault list database/roles
Keys ---- Role-1 Role-2 Role-3 Role-4 Role-5
Thanks!