如何从另一个文本文件将密码传递给 shell 脚本中的 su 命令。
password.txt 就像
password=tryme
shell脚本需要由用户gucq1运行
shell脚本就像
#!/bin/bash
cd /pstools/85419/jre/bin
java -Xms1024M -Xmx1024M -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 -jar /app1/nohr/soft/85419/gucq1/cust/classes/SVC_TestS.jar
我需要使用与使用 (autoid) 登录不同的 id (gucq1) 运行此脚本。
我不想使用 SUDO,因为我无权访问它。