2

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.
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Z.Szymon
  • 143
  • 7

1 Answers1

2
  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

glenn jackman
  • 84,176
  • 15
  • 116
  • 168