Certain Unix commands fail with “… not found”, when executed through Java using JSch even with setPty enabled

前端 未结 1 1094
南笙
南笙 2021-01-16 07:28

I\'m creating an android app that sends commands to a linux terminal on a device. I am able to get the proper output when using the \"ls\" command, however the device does n

相关标签:
1条回答
  • 2021-01-16 08:22

    Your server/shell is misconfigured somehow. It does not set the PATH correctly, when a shell session is not started. That's, why the ifconfig/iwconfig binaries cannot be found.

    Either fix your startup scripts to set the PATH correctly for all situations. Or use a full path to the ifconfig/iwconfig.

    To find the full path, open a regular shell session using your SSH client and type:

    which ifconfig
    

    For a similar issue, see Certain Unix commands fail with "... not found", when executed through Java using JSch.

    0 讨论(0)
提交回复
热议问题