Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Sed commands in open-vpn.yml rename the files using suffix "e" #40

Closed
michalklempa opened this issue May 19, 2016 · 1 comment
Closed

Comments

@michalklempa
Copy link

michalklempa commented May 19, 2016

Sed used with options (https://github.com/digitalocean/do_user_scripts/blob/master/Ubuntu-14.04/network/open-vpn.yml#L10)

sed -ie 's/.../.../' file.crt

does not only in-place editing but adds suffix 'e' to filename, causing result to be saved in

file.crte

This is due man sed:

       -i[SUFFIX], --in-place[=SUFFIX]

              edit files in place (makes backup if SUFFIX supplied)

where the 'e' is interpreted as param for -i option and not as next option -e and sed works with script supplied as first arg (if there is no other script supplied).
This simply breaks the whole script.

Solution: replace all sed commands dividing the options properly:

sed -i -e 's/.../.../' file.crt

the -e option in fact, is not necessary (but everybody uses sed in this way).
Working environment: Ubuntu 14.04 LTS, sed --version
sed (GNU sed) 4.2.2

@andrewsomething
Copy link
Member

😳 Thanks for catching that! I'll get it fixed up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants