Home Blog Bash Default and alternative command

Default and alternative command

The following command will return the gnumfmt command if it is available, otherwise it will use the numfmt command.

$(command -v gnumfmt || echo numfmt)