小编Chr*_*ris的帖子

管道 sed/grep 输出不起作用

如果我运行下面的命令,只有out1输出,out2out3为空。

# this is just to generate a self-signed certificate
openssl genrsa -out /tmp/ssl.key 2048
openssl req -sha256 -new -key /tmp/ssl.key -out /tmp/ssl.csr -subj /CN=localhost
openssl x509 -req -days 365 -in /tmp/ssl.csr -signkey /tmp/ssl.key -out /tmp/ssl.crt

# works
openssl s_server -cert /tmp/ssl.crt -key /tmp/ssl.key -accept 444 > out1
# does not work, but if I run without '> out2' it works
openssl s_server -cert /tmp/ssl.crt -key /tmp/ssl.key -accept 446 | sed "s/ACCEPT/ACCEPT445/g" > out2 …
Run Code Online (Sandbox Code Playgroud)

grep bash pipe sed io-redirection

1
推荐指数
1
解决办法
1670
查看次数

标签 统计

bash ×1

grep ×1

io-redirection ×1

pipe ×1

sed ×1