質問編集履歴
4
ああああああああ
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,1 +1,5 @@
|
|
1
|
-
|
1
|
+
#!/bin/sh
|
2
|
+
for i in `seq $1`
|
3
|
+
do
|
4
|
+
iperf -c $2
|
5
|
+
done
|
3
ああああああ
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,31 +1,1 @@
|
|
1
|
-
### 前提・実現したいこと
|
2
|
-
|
3
|
-
PHPのコードの中で、シェルスクプトを実行したいです。
|
4
|
-
|
1
|
+
あああああああああああああああああああああああああああああああああああああああああああああああ
|
5
|
-
このようにして、txtA,txtB,txtCの引数を利用して、最後にtxtCの中身を表示するというようなコードを書きたいですが、正直このコードがあっているのかどうかすらもわかりません。どうかご教授お願いします。
|
6
|
-
|
7
|
-
また、シェルスクリプトのコードでも質問なのですが、iperfというネット測定ツールを入力されたIPに実行し、その結果を出力するという、スクリプトを作っています。
|
8
|
-
txtAにはiperfコマンドを実行する回数が入り、txtBにその実行するIPアドレスが入り、txtCが保存するファイルの名前です。
|
9
|
-
このように書いたfor文でループさせ実行しようと思っているのですが、うまくいきませんでした。この部分もご教授お願いしたいです。
|
10
|
-
### 該当のソースコード
|
11
|
-
|
12
|
-
```cmd.sh
|
13
|
-
#!/bin/sh
|
14
|
-
|
15
|
-
function fun(){
|
16
|
-
|
17
|
-
for i in `seq txtA`
|
18
|
-
do
|
19
|
-
command="iperf -c txtB"
|
20
|
-
eval $command >> txtC
|
21
|
-
|
22
|
-
done
|
23
|
-
}
|
24
|
-
|
25
|
-
fun
|
26
|
-
|
27
|
-
```
|
28
|
-
### 該当のソースコード
|
29
|
-
|
30
|
-
|
31
|
-
```
|
2
ああああ
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,38 +27,5 @@
|
|
27
27
|
```
|
28
28
|
### 該当のソースコード
|
29
29
|
|
30
|
-
```PHP
|
31
|
-
<?php
|
32
|
-
include("header.php"); //echo the default Header entries
|
33
|
-
?>
|
34
30
|
|
35
|
-
<table width=98%>
|
36
|
-
<tr width=100% height="360px">
|
37
|
-
<td width=50%>
|
38
|
-
<form name="form1" action="sample.php" method="post">
|
39
|
-
<table width="10">
|
40
|
-
<tr width="10"><td width="85">サーバIP:</td><td><input type="text" name="txtA" size="15" ></td></tr>
|
41
|
-
<tr width="10"><td width="85">回数:</td><td><input type="text" name="txtB" size="3"></td></tr>
|
42
|
-
<tr width="10"><td width="85">ファイル名:</td><td><input type="text" name="txtC" size="10"></td></tr>
|
43
|
-
<tr width="10"><td width="85"><input type="submit" value="計算"></td><td></td></tr>
|
44
|
-
</form>
|
45
|
-
</td>
|
46
|
-
</tr>
|
47
|
-
<tr>
|
48
|
-
<td colspan=2>
|
49
|
-
<div>
|
50
|
-
<textarea name="hoge" rows="20" cols="90" value="てすと">
|
51
|
-
|
52
|
-
---------ここにPHPを記述-----------
|
53
|
-
|
54
|
-
</textarea>
|
55
|
-
</div>
|
56
|
-
</td>
|
57
|
-
</tr>
|
58
|
-
</table>
|
59
|
-
|
60
|
-
<?php
|
61
|
-
include("footer.php");
|
62
|
-
?>
|
63
|
-
|
64
31
|
```
|
1
PHPのコードを全文載せました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,8 +27,38 @@
|
|
27
27
|
```
|
28
28
|
### 該当のソースコード
|
29
29
|
|
30
|
+
```PHP
|
30
|
-
|
31
|
+
<?php
|
31
|
-
|
32
|
+
include("header.php"); //echo the default Header entries
|
32
|
-
|
33
|
+
?>
|
33
34
|
|
35
|
+
<table width=98%>
|
36
|
+
<tr width=100% height="360px">
|
37
|
+
<td width=50%>
|
38
|
+
<form name="form1" action="sample.php" method="post">
|
39
|
+
<table width="10">
|
40
|
+
<tr width="10"><td width="85">サーバIP:</td><td><input type="text" name="txtA" size="15" ></td></tr>
|
41
|
+
<tr width="10"><td width="85">回数:</td><td><input type="text" name="txtB" size="3"></td></tr>
|
42
|
+
<tr width="10"><td width="85">ファイル名:</td><td><input type="text" name="txtC" size="10"></td></tr>
|
43
|
+
<tr width="10"><td width="85"><input type="submit" value="計算"></td><td></td></tr>
|
44
|
+
</form>
|
45
|
+
</td>
|
46
|
+
</tr>
|
47
|
+
<tr>
|
48
|
+
<td colspan=2>
|
49
|
+
<div>
|
50
|
+
<textarea name="hoge" rows="20" cols="90" value="てすと">
|
51
|
+
|
52
|
+
---------ここにPHPを記述-----------
|
53
|
+
|
54
|
+
</textarea>
|
55
|
+
</div>
|
56
|
+
</td>
|
57
|
+
</tr>
|
58
|
+
</table>
|
59
|
+
|
60
|
+
<?php
|
61
|
+
include("footer.php");
|
62
|
+
?>
|
63
|
+
|
34
64
|
```
|