4 ms·
I start out like that, but often I end up having to remove -u if I'm e.g. trying to check if $1 is populated. Is there a way to do that while still using -u?
by cellularmitosis 10y ago
I start out like that, but often I end up having to remove -u if I'm e.g. trying to check if $1 is populated. Is there a way to do that while still using -u?
- mdaniel 10y agoSame as any potentially unbound variable, by providing a (possibly empty) default value: if [ "${1:-}" == "my awesome value" ]; then ...