๐พ Archived View for bbs.geminispace.org โบ s โบ bash โบ 19148 captured on 2024-08-31 at 15:42:35. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
It's the array variable expantion. here is an example:
x=( a b "c d" );
echo ${x[@]}
in this example a beginner would thinkg that ${x[@]} would be expanded to 3 fields but no. It would be expanded into 4 field a,b,c,d . It's very confusing. however to prevent it we just quote the parameter expansion like "${x[@]}" and now it would only expand to 3 fields :)
hope you learned something new.
Aug 21 ยท 10 days ago ยท ๐ lanterm, nerd, coldcalzone
๐ Addison ยท Aug 28 at 01:49:
It's very confusing
This is Bash in general. I'm convinced it's not meant to be used by humans.
This is good to know, thank you for pointing it out!