回答編集履歴
2
追記
test
CHANGED
@@ -23,3 +23,37 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
備考: [nohupコマンドでnohup.outではなく標準出力に出力する方法 - システム開発メモ](http://progmemo.wp.xdomain.jp/archives/433)
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
上記に続いて「ターミナルを閉じてしまったプロセスの標準出力をもう一度確認したい」という場合は
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```bash
|
34
|
+
|
35
|
+
# Linux用
|
36
|
+
|
37
|
+
tail -f /proc/プロセス番号/fd/1
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
# OSX(macOS)用
|
42
|
+
|
43
|
+
sudo dtrace -p プロセス番号 -qn '
|
44
|
+
|
45
|
+
syscall::write*:entry
|
46
|
+
|
47
|
+
/pid == $target && arg0 == 1/ {
|
48
|
+
|
49
|
+
printf("%s", copyinstr(arg1, arg2));
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
'
|
54
|
+
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
備考: [osx - How can I capture the stdout from a process that is ALREADY running - Stack Overflow ](http://stackoverflow.com/questions/3425340/how-can-i-capture-the-stdout-from-a-process-that-is-already-running)
|
1
追記
test
CHANGED
@@ -10,14 +10,16 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
|
13
|
+
「ターミナルを開いている間は標準出力を確認したい,但し`nohup.out`は要らない」という場合は
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
```bash
|
18
|
+
|
19
|
+
cat <(nohup node app.js 2>&1 </dev/null)
|
20
|
+
|
17
|
-
|
21
|
+
```
|
18
22
|
|
19
23
|
|
20
24
|
|
21
|
-
|
25
|
+
備考: [nohupコマンドでnohup.outではなく標準出力に出力する方法 - システム開発メモ](http://progmemo.wp.xdomain.jp/archives/433)
|
22
|
-
|
23
|
-
- [プロセスのバックグラウンド化(nohupとdisown) - Qiita](http://qiita.com/is0me/items/a9884a6fc2ae96212291)
|