Refactor config generator#43
Open
mmtj wants to merge 2 commits intopulseaudio-equalizer-ladspa:masterfrom
Open
Refactor config generator#43mmtj wants to merge 2 commits intopulseaudio-equalizer-ladspa:masterfrom
mmtj wants to merge 2 commits intopulseaudio-equalizer-ladspa:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Unfortunately PR #41 fixed issue by side effect. This PR intends to provide proper fix and little refactoring.
Trouble is that regular expression in sed never matches and thus keep string unchanged.
trimmed=$(echo $RAWDATA1 | sed 's/ *$//g')What actually trim first space is echoing
$RAWDATAwithout quotation marks.echo "$RAWDATA1would echo string as is, but regexp in sed still wouldn't match.So I tried to go full bash route here, but I could just rewrite sed expression if you prefer that.
There is practically identical block of code which could look better in own reusable function. Only caveat I see here is that this code will work only on bash 4.3+, because of nameref used here.