sophiakoulen / minishell

A simplified bash-like shell, with pipes, redirections and variable expansion.
4 stars 1 forks source link

linux wildcard expanstion wierdness is back #111

Open znichola opened 1 year ago

znichola commented 1 year ago
Testing wildcard expansion 
 0 KO
   :  Inputted '
echo *
'
   :  Expected 'aaaazzzzaaazz Afirst apple apple1 apple2 apple3 applebananna bannana drapple fapple launch_tests.sh not.hidden papplez run_export_test.sh run_issues_test.sh run_wildcard_test.sh test_framework.sh thisthatthis tmp Zafirstest Zfirst'
   :  Received 'Afirst Zafirstest Zfirst aaaazzzzaaazz apple apple1 apple2 apple3 applebananna bannana drapple fapple not.hidden papplez run_export_test.sh run_wildcard_test.sh test_framework.sh thisthatthis tmp'

 1 KO
   :  Inputted '
echo *.sh
'
   :  Expected 'launch_tests.sh run_export_test.sh run_issues_test.sh run_wildcard_test.sh test_framework.sh'
   :  Received 'run_export_test.sh run_wildcard_test.sh test_framework.sh'

I truly have no idea what order the files are listed in on linux, it's almost alphabetical and why some files are not listed idk, but it works on mac

znichola commented 1 year ago

yep it's still here, stuff isn't displayed in the same order, and this is frustrating.

sophiakoulen commented 1 year ago

This is probably because in school we use an older version of bash, version 3.2. On my debian, i have version 5.1, and i have the same difference. It's just a difference in the sort function that is case-insensitive i think.

znichola commented 1 year ago

ah, this makes sense, good find. We could pipe the output into a sort echo * | sort to get consistent results between systems, but then I feel like all the hard work that went into sorting the list internally is under valued :(