Thanks! That's not even close to what the docs suggest it does--no idea
what's up with that. With your example, I was able to figure out
exactly what the issue is. On Ubuntu 18/bash 4.4, dot is rejected in
the name of the variable to substitute, which is sane in principle as
dots aren't allowed in variable names, but it's a regression from Ubuntu
16/bash 4.3.
For example:
% docker run -ti ubuntu:16.04 /bin/bash
root@9a36ac04f2ff:/# k=l.m
root@9a36ac04f2ff:/# echo ${!k}
root@9a36ac04f2ff:/# exit
% docker run -ti ubuntu:18.04 /bin/bash
root@36ce0eb1d846:/# k=l.m
root@36ce0eb1d846:/# echo ${!k}
bash: l.m: bad substitution
root@36ce0eb1d846:/# exit
This issue only shows up if the user uses the hadoop command to run an
arbitrary class not in the default package, e.g. "hadoop
org.apache.hadoop.conf.Configuration". We've been quietly allowing that
misuse forever. Unfortunately, treating CLI output as an API means we
can't change that behavior in a minor. We could, however, deprecate it
and add a warning when it's used. I think that would cover us
sufficiently if someone trips on the Ubuntu 18 regression.
Thoughts?
Daniel
On 3/1/19 3:52 PM, Allen Wittenauer wrote:
On Mar 1, 2019, at 3:04 PM, Daniel Templeton <templ...@apache.org> wrote:
There are a bunch of uses of the bash syntax, "${!var}", in the Hadoop scripts.
Can anyone explain to me what that syntax was supposed to achieve?
#!/usr/bin/env bash
j="hi"
m="bye"
k=j
echo ${!k}
k=m
echo ${!k}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org