PROfile=`cat ~/script/ssh-profiles/`echo [ssh $PROfile]ssh $PROfile
〜/脚本/ SSH型材/ tummi
-i ~/DropBox/security/key-nopass/key-nopass.pvt [email protected]
当我运行脚本时,它失败了:
bart@bart-laptop:~$script/ssh-profiled.sh tummi[ssh -i ~/DropBox/security/key-nopass/key-nopass.pvt [email protected]]Warning: IDentity file ~/DropBox/security/key-nopass/key-nopass.pvt not accessible: No such file or [email protected]'s password:
但这有效:
bart@bart-laptop:~$ssh -i ~/DropBox/security/key-nopass/key-nopass.pvt [email protected] tummi 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC 2010 x86_64 GNU/linuxUbuntu 10.04.1 LTSWelcome to the Ubuntu Server!
我的脚本中是否有错误/陷阱?
解决方法 将第1行更改为eval PROfile=`cat ~/script/ssh-profiles/`
有关解释,请参阅here
总结以上是内存溢出为你收集整理的linux – 命令在脚本中不起作用,但在shell中起作用全部内容,希望文章能够帮你解决linux – 命令在脚本中不起作用,但在shell中起作用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)