The trap of Bash trap
摘要: When executing a pipe, each command of the pipe is in a separate process from the Bash process. The variable modified by the function is lost. The exit code of the function is also lost, because the exit code of a pipe is the exit code of the last command of the pipe.阅读全文