I want to call task (https://taskfile.dev/) in a single line command. But on some systems task is installed as task, while on others as go-task. On my system I have defined an alias in the shell task=go-task.
Is there some concisely syntax:
task --help
maybe similar to default variable values, ${task:-go-task} --help ?
This would be helpful in cases like, podman and docker or many more as well.
edit:
if command -v task &> /dev/null ; then task=task ; else task=go-task ; fi && $task --help
does not work, since task is an alias. In this case I get bash: task: command not found....
Try with: