Skip to content

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