这有效
bash
ifconfig
这失败了
bash ifconfig
/sbin/ifconfig: /sbin/ifconfig: cannot execute binary file
它不是/ sbin,因为我尝试将ifconfig(或任何其他二进制文件)复制到其他位置,例如
cp /sbin/ifconfig ~
bash ~/ifconfig
/root/ifconfig: /root/ifconfig: cannot execute binary file
我试过在/ etc / profile中打印'id -a'和LD_LIBRARY_PATH进行调试,并且看起来都一样。
有任何想法吗?
当您键入时bash ifconfig
,bash会将“ ifconfig”解释为您希望bash运行的脚本文件的名称。Bash抱怨是因为它不希望ifconfig是二进制文件。正确的格式为bash -c ifconfig
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句