I've been tasked with refactoring a bash script, and I've encountered the following statement...
if [[ -n "${myvar:-n}" && "${myvar}" == "Y" ]]
then
....
I understand that this is checking if the variable is not null and equals "Y", but I'm not sure what the ":-n" is for.
From the testing I've done, it doesn't seem to actually do anything, but I assume it must have been put there for some purpose.
I haven't been able to find any documentation mentioning this.