Chmod777 *. Sh
Yesterday afternoon I 've been debugging How to Use Net: SSH in Ruby to call Linux script files.
The basic Linux Command is okay, and the returned value is OK, that is, the newly added sh file cannot be called, prompting command not found
After searching for a long time, it was basically found that the environment variable could not be used, but the absolute path could not be written directly, and the result would still not work ....
Prompt Java: Command not found
This is a problem with Java environment variables.
The result is to modify the environment variables of the logged-on user in Linux. Check that the configuration is also configured. In the end, compare it with the previous SH, and then specify the environment variables in Sh.
Ah, it turned out to be so simple. I had to spend the afternoon on myself. I am not familiar with Linux .....
Set environment variables in the sh script
#! /Bin/sh
Java_home="/Usr/Alibaba/java6"
Export path=$ Java_home/Bin:$ Path
Then you need to set the permissions for an SH file.