In sqlplus there is an option to execute standard shell commands, simply by prefixing them with '!'. Example: SQL>!ps -af returns expected processes. My question is, is there an option to execute user defined aliases in the same way? So far I tried:

  1. In .bash_profile: alias sample="ps -af".
  2. In sqlplus SQL>!sample. This doesn't work. /bin/bash: sample: command not found.
  1. the ~/.bash_profile is only processed for a login shell.
  2. Aliases are only available in an interactive bash session.

So, referencing Invoking Bash: !bash -lic sample

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.