大佬教程收集整理的这篇文章主要介绍了我如何从另一个 shell 脚本调用源 ~./.bash_profile 脚本?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/bin/sh
~/.bash_profile
#main.sh has following
tar -xzvf /home/admin/perf/jdk-8u201-linux-x64.tar.gz >> /home/admin/perf/output.txt &&
sleep 1
echo "Export Path for Environmental Variable"
sudo echo "export PATH=/home/admin/perf/jdk1.8.0_201/jre/bin/:/home/admin/perf/jdk1.8.0_201/bin/:$PATH" >> /home/admin/.bash_profile
sudo echo "export JAVA_HOME=:/home/admin/perf/jdk1.8.0_201" >> /home/admin/.bash_profile
sleep 1
echo "PersisTing JDK PATH to .bash_profile"
source /home/admin/perf/./source.sh
when I execute ./main.sh
#Result is ./source.sh script is not setTing the export path in the same sHell.
#!/usr/bin/bash
用于重生 sHell,即 bash,在大多数系统上,这是 bash 脚本的第一行,您的行 #!/bin/sh
可能不正确。但我可能错了。
要调用 bash_profile,您可以输入 source ~/.bash_profile
但我会查看第一行,即解释器。
以上是大佬教程为你收集整理的我如何从另一个 shell 脚本调用源 ~./.bash_profile 脚本?全部内容,希望文章能够帮你解决我如何从另一个 shell 脚本调用源 ~./.bash_profile 脚本?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。