Having an issue with java code which has to be executed on linux terminal : <p>I am a beginner in writing Java code. I am having trouble on executing command which is written on Java. I am trying to execute the command2. The code is below</p>

<pre><code>import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class OSinventory2 {
    public static void main(String[] args) throws IOException, InterruptedException {

    OSinventory2 obj = new OSinventory2();
    String PATH="/usr/bin:/usr/sbin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin";
    String LD_LIBRARY_PATH="/usr/lib:/usr/ccs/lib:/usr/local/lib";
    String FP="ls -ld ~/mnt/c/Users/aitol/Desktop/Java/TESTING 2&gt; /dev/null";
    String HOSTN="hostname | tr [:upper:] [:lower:]";

    if (obj.executeCommand(FP) != null){
        String command = "mkdir -p /mnt/c/Users/aitol/Desktop/Java/TESTING/Larry";
        System.out.println(obj.executeCommand(command)); 
    }

        String command2 = "touch /mnt/c/Users/aitol/Desktop/Java/TESTING/${`HOSTN`}.txt";
        System.out.println(obj.executeCommand(command2));

    }

private String executeCommand(String command1) {

    StringBuffer output = new StringBuffer();

    Process p;
    try {
        p = Runtime.getRuntime().exec(command1);
        p.waitFor();
        BufferedReader reader =
                new BufferedReader(new InputStreamReader(p.getInputStream()));

        String line = "";
        while ((line = reader.readLine())!= null) {
            output.append(line).append("\n");
        }

    } catch (Exception e) {
        e.printStackTrace();
    }

    return output.toString();

} }
</code></pre>

<p><a href="https://i.stack.imgur.com/q6n06.jpg" rel="nofollow noreferrer">And the output is here : (click)</a></p>

<p>Please Help! Thank you!</p>
