I am not sure if anyone of these operations helps you.
echo M40 | . oraenv
This one uses echo
pipe.
printf M40 | . oraenv
This one uses printf
for pipe. Using echo
is different from using printf
in some situations, however I don't know their actual difference.
. oraenv <<< M40
This one uses Here String (Sorry for using ABS as reference), a stripped-down form of Heredoc.
. oraenv < <(echo M40)
This one uses Process Substitution, you may see https://superuser.com/questions/1059781/what-exactly-is-in-bash-and-in-zsh for the difference between this one and the above one.
expect -c "spawn . oraenv; expect \"nput\"; send \"M40\r\n\"; interact"
This one uses expect
to do automatic input, it has more extensibility in many situations. Note to change the expect \"nput\"
part with your actual situation.