Repeated Command Calls #6

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

Called in multiple functions:

systemctl list-unit-files 2>/dev/null | grep -q node_exporter
systemctl list-unit-files 2>/dev/null | grep -q hwmon.timer

Optimization: Cache the output once:

UNIT_FILES=$(systemctl list-unit-files 2>/dev/null)

# Called in multiple functions: systemctl list-unit-files 2>/dev/null | grep -q node_exporter systemctl list-unit-files 2>/dev/null | grep -q hwmon.timer Optimization: Cache the output once: UNIT_FILES=$(systemctl list-unit-files 2>/dev/null)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/proxDoc#6