DEV Community

Discussion on: //TODO: Refactor me - A guide to measuring shortcuts

Collapse
 
moopet profile image
Ben Sinclair

In bash, you can assign defaults to variables, so you could use

KEYWORD=${1:-TODO}
Enter fullscreen mode Exit fullscreen mode

to make your script look for "TODO" or whatever you passed it as an argument.

Collapse
 
thormeier profile image
Pascal Thormeier

Thank you for, I wasn't aware of that! Will add this to the article :)