rancher / k3os

Purpose-built OS for Kubernetes, fully managed by Kubernetes.
https://k3os.io
Apache License 2.0
3.5k stars 397 forks source link

quote $0 occurances in scripts #717

Closed ghost closed 2 years ago

ghost commented 3 years ago

quote $0 occurances in scripts to avoid breakage on space characters in directory names

rgl commented 3 years ago

I think you missed another critical step, everything that uses the quoted $0 must also be quoted. For example, $(dirname "$0")/version should be "$(dirname "$0")/version".

But I have no horse in this race. Using directories with spaces should be banished upfront :-D

dweomer commented 2 years ago

@netzverweigerer please re-open after making the changes described by @rgl: https://github.com/rancher/k3os/pull/717#issuecomment-870745561

I think you missed another critical step, everything that uses the quoted $0 must also be quoted. For example, $(dirname "$0")/version should be "$(dirname "$0")/version".

But I have no horse in this race. Using directories with spaces should be banished upfront :-D