如何将登录/密码隐藏到shell中?

如何将登录/密码隐藏到shell中?

我有一个 Shell 脚本(.run),可以让我连接到 Oracle sql :

    echo whenever sqlerror exit | sqlplus Login/Passwd@SERVER @"TABLE1.sql"

echo 'return code : ' $?

我想隐藏“登录名/密码@SERVER”请通过将其调用到另一个 shell 或任何其他方式。谢谢你的帮助

答案1

如果你只是想隐藏该值,您可以将其放入您将获取的另一个脚本中的变量中:

. /path/to/other_script
echo whenever sqlerror exit | sqlplus "$HIDDEN" @"TABLE1.sql"

其中other_script包含:

HIDDEN='Login/Passwd@SERVER'

other_script必须可读...

相关内容