Follow

This is a gem:

If you want your bash scripts to use a default value for your variable $ABC but still want to override that variable on the prompt, do

```bash
: ${ABC:="DefaultContent"}
```

in your script. And

```bash
ABC="SpecialContent" ./yourscript.sh
```

(okay, not really, the code is ugly af)

stackoverflow.com/questions/46

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.