0

import java.io.*;
public class testprog

{


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

        String command="find BEL/ -type f | wc -l";
        Process p=Runtime.getRuntime().exec(command);
        p.waitFor();
        BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line=reader.readLine();
        while(line!=null)
        {
            System.out.println(line);
            line=reader.readLine();
        }


    System.out.println("Done");
}


}

It's return null value. plz help me

3
Contributors
2
Replies
14
Views
2 Years
Discussion Span
Last Post by jwenting
0

And your problem is? What is the forward slash in the "find" command? You are specifying the BEL directory with the find command. The slash is extraneous and may cause a parsing error, unless you have multiple directories at the same level that start with BEL.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.