4 ms·
Lets say you write in bash like this: if [[ $OPTION =~ = ]] then declare "BOCKER_${OPTION/=*/}=${OPTION/*=/}" else declare "BOCKER_${OPTION}=
by kubanczyk 7y ago
Lets say you write in bash like this:
if [[ $OPTION =~ = ]]
then
declare "BOCKER_${OPTION/=*/}=${OPTION/*=/}"
else
declare "BOCKER_${OPTION}=x"
fi
Going from here, if you rewrite this in golang you'd probably improve readability.
But the readability has not been "thrown out of the window" yet, like in this case:
[[ $OPTION =~ = ]] && declare "BOCKER_${OPTION/=*/}=${OPTION/*=/}" || declare "BOCKER_${OPTION}=x"
- takeda 7y agoOh I see your point. Yeah, that was unnecessary. Ironically now I remember that I was once frustrated by someone who was using Boolean logic to emulate if/else in Python.