/
hubbitus
/
shell.scripts
Обзор
Документация
Войти
/
hubbitus
/
shell.scripts
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
SHARED/stderr.pipe
10 строк
398 B
Pavel Alexeev
Initial import all of my (Hubbitus) scripts
04 дек 2008, 11:35
04 дек 2008, 11:35
cb548b1
Код
Авторство
О чём код?
#!/bin/bash #http://wooledge.org:8000/BashFAQ?action=show&redirect=BashFaq#head-3ea5ee0ab12df2fd6f37f29b32c061436943232d # Redirect stderr to a pipe, keeping stdout unaffected. exec 3>&1 # Save current "value" of stdout. myprog 2>&1 >&3 | grep ... # Send stdout to FD 3. exec 3>&- # Now close it for the remainder of the script. # Thanks to http://www.tldp.org/LDP/abs/html/io-redirection.html