Skip to content

Commit

Permalink
fix usage of sed with -i option
Browse files Browse the repository at this point in the history
* 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: `.'
  • Loading branch information
darxriggs committed Sep 15, 2015
1 parent 1444636 commit ea26bfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./...
Expand Down Expand Up @@ -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=. ./...
Expand Down
8 changes: 4 additions & 4 deletions scripts/generate_gettingstarted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ea26bfe

Please sign in to comment.