From 99bda4047ad2b85c2aadf9c0c83a672857ef5719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scheibe?= Date: Tue, 15 Sep 2015 23:21:35 +0200 Subject: [PATCH] fix usage of sed with -i option * when using sed with -i it's crucial to not put any spaces between -i and SUFFIX * good: sed -i.bk ... * bad: sed -i .bk ... * otherwise this error is shown when using GNU sed 4.2.2: sed: -e expression #1, char 1: unknown command: `.' --- Makefile | 4 +--- scripts/generate_gettingstarted.sh | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a7e7b2bf11dd..bc0db6ccb333 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ darwin_dist: packetbeat cp packetbeat packetbeat-$(VERSION)-darwin cp etc/packetbeat.yml packetbeat-$(VERSION)-darwin/ cp etc/packetbeat.template.json packetbeat-$(VERSION)-darwin/ - sed -i .bk 's/device: any/device: en0/' packetbeat-$(VERSION)-darwin/packetbeat.yml + sed -i.bk 's/device: any/device: en0/' packetbeat-$(VERSION)-darwin/packetbeat.yml rm packetbeat-$(VERSION)-darwin/packetbeat.yml.bk tar czvf packetbeat-$(VERSION)-darwin.tgz packetbeat-$(VERSION)-darwin shasum packetbeat-$(VERSION)-darwin.tgz > packetbeat-$(VERSION)-darwin.tgz.sha1.txt @@ -76,7 +76,6 @@ install_cfg: cp etc/packetbeat.yml $(PREFIX)/packetbeat-win.yml sed -i.bk 's/device: any/device: 0/' $(PREFIX)/packetbeat-win.yml - .PHONY: gofmt gofmt: go fmt ./... @@ -104,7 +103,6 @@ coverage: GOPATH=$(shell $(GODEP) path):$(GOPATH) $(GOPATH)/bin/gotestcover -coverprofile=./coverage/unit.cov -covermode=count github.com/elastic/packetbeat/... $(GODEP) go tool cover -html=./coverage/unit.cov -o coverage/unit.html - .PHONY: benchmark benchmark: $(GODEP) go test -short -bench=. ./... diff --git a/scripts/generate_gettingstarted.sh b/scripts/generate_gettingstarted.sh index c2b0a92cae6e..d168d64bb755 100755 --- a/scripts/generate_gettingstarted.sh +++ b/scripts/generate_gettingstarted.sh @@ -36,8 +36,8 @@ EOF cat $INPUT >> $OUTPUT -sed -i .bk "s/\$PB_VERSION/$PB_VERSION/g" $OUTPUT -sed -i .bk "s/\$ES_VERSION/$ES_VERSION/g" $OUTPUT -sed -i .bk "s/\$KIBANA_VERSION/$KIBANA_VERSION/g" $OUTPUT -sed -i .bk "s/\$DASHBOARDS_VERSION/$DASHBOARDS_VERSION/g" $OUTPUT +sed -i.bk "s/\$PB_VERSION/$PB_VERSION/g" $OUTPUT +sed -i.bk "s/\$ES_VERSION/$ES_VERSION/g" $OUTPUT +sed -i.bk "s/\$KIBANA_VERSION/$KIBANA_VERSION/g" $OUTPUT +sed -i.bk "s/\$DASHBOARDS_VERSION/$DASHBOARDS_VERSION/g" $OUTPUT rm $OUTPUT.bk