Asdf: Consider Banning echo command

Created on 18 Aug 2020  路  3Comments  路  Source: asdf-vm/asdf

Is your feature request related to a problem? Please describe.

As described in https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo/65819#65819, echo has a lot of disadvantages and should never be passed uncontrolled data, which is something we often do.

Describe the solution you'd like

Banning the echo command entirely would be an effective way of avoiding these issues and would force us to be more explicit with printf formatting.

Describe workarounds you've considered

We can continue use echo when it printing controlled data, but the inconsistency may not be caught by reviewers or our code quality tools. Banning the command would ensure these issues are not possible.

enhancement

Most helpful comment

@jthegedus https://github.com/asdf-vm/asdf/pull/806 is ready for review now.

All 3 comments

I was going to suggest banning echo on my output refactor/standardisation. printf is definitely my preference here.

@jthegedus https://github.com/asdf-vm/asdf/pull/806 is ready for review now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hackrole picture hackrole  路  5Comments

michalmuskala picture michalmuskala  路  5Comments

peleteiro picture peleteiro  路  3Comments

niksfirefly picture niksfirefly  路  3Comments

romenigld picture romenigld  路  4Comments