Subshell Overhead #9

Open
opened 2026-02-02 15:20:20 -05:00 by jared · 0 comments
Owner

runDiags() {
(
get_system_info
get_cpu_info
# ... many functions
) & show_progress $!

Issue: Unnecessary subshell. Functions already output to stdout. Better to redirect output once:

{
get_system_info
get_cpu_info
# ...
} 2>&1 | tee -a "$LOGFILE" &
show_progress $!

runDiags() { ( get_system_info get_cpu_info # ... many functions ) & show_progress $! Issue: Unnecessary subshell. Functions already output to stdout. Better to redirect output once: { get_system_info get_cpu_info # ... } 2>&1 | tee -a "$LOGFILE" & show_progress $!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/proxDoc#9