When I run
cd My folder
There is an error because I have not protected the string.
bash: cd: My: No such file or directory
But this works fine
cd "My folder"
Is there a way to redefine cd
as an alias or a function so that it automatically protects all the following arguments as one single string?
This approach did not work, as I supposed it wouldn't:
cd () { cd "$*" ; }