Relate from my first question at Execute linux command in java and display output to html table I have manage to get it work, but I still have one other question: how I can remove the first line from the output? Below is the code:
<%
String[] disk;
String line;
String process;
Process p;
BufferedReader input;
p = Runtime.getRuntime().exec("df -h");
input = new BufferedReader(new InputStreamReader(p.getInputStream()));
%>
<tr bgcolor="#f0f0f0">
<td>
<b>Disk</b>
</td>
<td>
<b>Size</b>
</td>
<td>
<b>Used</b>
</td>
<td>
<b>Avail</b>
</td>
<td>
<b>Use %</b>
</td>
<td>
<b>Mounted</b>
</td>
<td>
</td>
</tr>
<%
while ((line = input.readLine()) != null)
{
disk = line.split("\\s+");
%>
<tr>
<td><% out.println(disk[0]); %></td>
<td><% out.println(disk[1]); %></td>
<td><% out.println(disk[2]); %></td>
<td><% out.println(disk[3]); %></td>
<td><% out.println(disk[4]); %></td>
<td><% out.println(disk[5]); %></td>
</tr>
<%
}
input.close();
%>
The output is like:
What I want to remove is Filesystem Size Used Avail Use% Mounted
that showing after table header.