Posting it here something that is puzzling me; upgrading an application server from Jessie to Stretch broke a
Upon investigation, we narrowed it to a change of behaviour of the
cd command. I am not discussing here if what the script is doing is a good idea, or if it could be improved, I am just focusing in a behaviour change /awareness of changes mindset.
$echo *-* xxxx-1.0b xxxx-run $cd *-*
cd works and cds to the first directory ; actually *-run is a symbolic link to the same directory.
$echo *-* xxxx-1.0b xxxx-run $cd *-* bash: cd: too many arguments
bash is 4.3.30(1) in Jessie, and 4.4.12(1) in Stretch.
Why the change in behaviour between Jessie and Stretch?
Here is Solutions:
See the Relase Notes of bash 4.4, especially
qq. There is a new option settable in config-top.h that makes multiple
directory arguments to
cda fatal error.
BTW, I didn’t know. I just googled for “bash cd number 4.4”.
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂