Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't leave an extra shell open on Linux/macOS #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielzgtg
Copy link

@danielzgtg danielzgtg commented Dec 11, 2022

exec can be used before a command to replace the shell process with the next command. It is commonly used at the end of scripts to save having to create a new process. This change should save a tiny bit of memory.

Before

home@daniel-desktop3:~$ ps -ef | grep Loader
home       24040   23833  0 18:18 ?        00:00:00 /bin/sh -c ./'Cities_Loader.sh' '--no-sandbox'
home       24041   24040  0 18:18 ?        00:00:00 /bin/sh ./Cities_Loader.sh --no-sandbox
home       24279   24231  0 18:18 pts/4    00:00:00 grep Loader

After

home@daniel-desktop3:~$ ps -ef | grep Loader
home       25315   25142  0 18:20 ?        00:00:00 /bin/sh -c ./'Cities_Loader.sh' '--no-sandbox'
home       25462   24231  0 18:20 pts/4    00:00:00 grep Loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant