Access vault secret from bash script
The vault docs mention a -field parameter for the read subcommand.  So you should be able to put this into a shell script:
SECRET=$(vault read -field foo secret/mysecret)

Other vault docs use the vault kv get in the same way so you might try:
SECRET=$(vault kv get -field foo secret/mysecret)