a dále viz https://stackoverflow.com/questions/911168/how-to-detect-if-my-shell-script-is-running-through-a-pipe