erts: Remove some external commands in Unix scripts #10647
+3
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove calls to some external utilities (awk, basename, sed) in the erl and start_erl scripts, replacing them with POSIX shell parameter expansion and 'read' built-ins.
This improves compatibility with embedded systems and restricted environments where these tools may be missing, particularly on older releases of Android.
Notes on the shell built-ins used:
"${0##*/}": A POSIX parameter expansion that removes the longest prefix matching '*/'. This pattern matches everything up to and including the last slash, effectively performing a 'basename' operation entirely within the shell. This also covers the case when there is no slash character at all.read -r VAR1 VAR2 < File: Read the first line of a file and assigns the first two space-separated words to each variable, replacing the 2 external calls to 'awk'.Let me know if you have any questions.
Thanks,
Jérôme
P.S. I was waiting for #10573 to be merged first, it was applied into master earlier today.