[OCLUG-Tech] some weird shell parameter substitution constructs

2018-04-08 Thread Robert P. J. Day
not sure if i'm reading a shell script properly ... here's a script for downloading and installing kubernetes: https://get.kubernetes.io/ but it seems to be doing strange (messy) things with parameter substitution. first, there's this bit of weirdness partway through the script: if

Re: [OCLUG-Tech] some weird shell parameter substitution constructs

2018-04-08 Thread Stephen M. Webb
On 2018-04-08 04:21 AM, Robert P. J. Day wrote: > not sure if i'm reading a shell script properly ... here's a script > for downloading and installing kubernetes: > > https://get.kubernetes.io/ > > but it seems to be doing strange (messy) things with parameter > substitution. > > first,

Re: [OCLUG-Tech] some weird shell parameter substitution constructs

2018-04-08 Thread Robert P. J. Day
On Sun, 8 Apr 2018, Stephen M. Webb wrote: > On 2018-04-08 04:21 AM, Robert P. J. Day wrote: > > not sure if i'm reading a shell script properly ... here's a script > > for downloading and installing kubernetes: > > > > https://get.kubernetes.io/ > > > > but it seems to be doing strange

Re: [OCLUG-Tech] some weird shell parameter substitution constructs

2018-04-08 Thread Stephen M. Webb
On 2018-04-08 09:04 AM, Robert P. J. Day wrote: > i would have been shocked if that construct had that obvious a > security hole, given how often i've seen it in shell scripts. LOL remember shellshock? env x='() { :;}; echo vulnerable' bash -c "echo this is a test" Unfortunately I don't

Re: [OCLUG-Tech] some weird shell parameter substitution constructs

2018-04-08 Thread Robert P. J. Day
On Sun, 8 Apr 2018, Stephen M. Webb wrote: > On 2018-04-08 04:21 AM, Robert P. J. Day wrote: > > and there's this near the top: > > > > KUBERNETES_RELEASE_URL="${KUBERNETES_RELEASE_URL:-https://dl.k8s.io}; > > > > ok, that will admittedly set that variable to a value if it does not > > already