Skip to content

Refactor config generator#43

Open
mmtj wants to merge 2 commits intopulseaudio-equalizer-ladspa:masterfrom
mmtj:refactor-config-generator
Open

Refactor config generator#43
mmtj wants to merge 2 commits intopulseaudio-equalizer-ladspa:masterfrom
mmtj:refactor-config-generator

Conversation

@mmtj
Copy link
Copy Markdown
Contributor

@mmtj mmtj commented Nov 5, 2019

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 $RAWDATA without quotation marks. echo "$RAWDATA1 would 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.

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