potiuk edited a comment on pull request #21145:
URL: https://github.com/apache/airflow/pull/21145#issuecomment-1025659012


   You can read more about the bash magic you can do with variable substitution 
(this is the exact thing)  
https://tldp.org/LDP/abs/html/parameter-substitution.html
   
   Also what's part of the magic here: 
   
   * `${1//[.-]/ }` - the 'space' between `/` and `}` matter - this is how we 
get the parameters to be separated
   * It is important that there is no `"` around it. The `printf 
"%03d%03d%03d%.0s" "${1//[.-]/ }"` would not work because the "2 20 1"  would 
be seen as single parameter. This is kinda unusual use and usually you want 
those quotes. This is why shellcheck (our pre-commit static check for bash 
code) complained and this is why I had to add ` # shellcheck 
disable=SC2086,SC2183 ` to stop it from complaining.
   
   Now I think you should know why we want to get rid of Bash :). If explaining 
one line of bash takes 2-3 paragraph of text, it means that we should get rid 
of it. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to