[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] When to use exec to run a program?
From: |
Peng Yu |
Subject: |
[Help-bash] When to use exec to run a program? |
Date: |
Fri, 3 Jun 2016 20:25:45 -0500 |
Hi, I've read the description here. For exec, I see many scripts in
which the last externally command is exec'ed, which saves one fork()
call, hence should be faster.
https://lists.gnu.org/archive/html/help-bash/2015-08/msg00014.html
In this case, should I always use exec whenever possible? For example,
would something like the following be preferred in a pipeline?
exec cmd1 | exec cmd2
Or exec should not be used in the case of pipeline.
cmd1 | cmd2
What about the usage of <(exec cmd)? Is it recommended?
--
Regards,
Peng
- [Help-bash] When to use exec to run a program?,
Peng Yu <=