Skip to content

get-stage3.sh: Replace non-POSIX ${FILE/${DATE}/current} with sed - #8

Merged
mrunalp merged 1 commit into
opencontainers:masterfrom
wking:get-stage3-sed-substitution
Jan 21, 2016
Merged

get-stage3.sh: Replace non-POSIX ${FILE/${DATE}/current} with sed#8
mrunalp merged 1 commit into
opencontainers:masterfrom
wking:get-stage3-sed-substitution

Conversation

@wking

Copy link
Copy Markdown
Contributor

${parameter/pattern/string}isn't in POSIX 2013, which leads to:

43: ./get-stage3.sh: Bad substitution

when folks run a strictly-POSIX shell. Replace it with command
substitution
invoking echo and sed.

An alternative to #5.

${parameter/pattern/string} isn't in POSIX 2013 [1], which leads to:
43: ./get-stage3.sh: Bad substitution
when folks run a strictly-POSIX shell. Replace it with command
substitution [2] invoking echo [3] and sed [4].
[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03
[3]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
[4]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
Reported-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: W. Trevor King <wking@tremily.us>
@mrunalp

Copy link
Copy Markdown
Contributor

Thanks! LGTM.

mrunalp pushed a commit that referenced this pull request Jan 21, 2016
get-stage3.sh: Replace non-POSIX `${FILE/${DATE}/current}` with sed
@mrunalp
mrunalp merged commit 51bcff1 into opencontainers:masterJan 21, 2016
@mrunalpmrunalp mentioned this pull request Jan 21, 2016
@wking
wking deleted the get-stage3-sed-substitution branch March 8, 2016 04:25
wking pushed a commit to wking/ocitools-v2 that referenced this pull request Nov 17, 2016
CONTRIBUTING: Allow collaborative pull requests
Sign up for freeto 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.

2 participants

@wking@mrunalp