Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spaces with bash

Tags:

bash

I'm trying to make an export of a folder with spaces... but I did'nt find out how...

:~> export PATH="/home/solo/VirtualBox\ VMs/"
:~> cd $PATH
bash: cd: /home/solo/VirtualBox\: No existe el fichero o el directorio

I thought that with a "\" I could solve but did not.

like image 801
maniat1k13 Avatar asked Jul 04 '26 00:07

maniat1k13


1 Answers

You've already escaped it with the quotes; there's no need for a backslash, just don't forget the quotes each time. But FFS, don't use $PATH; that env var is important.

like image 151
Ignacio Vazquez-Abrams Avatar answered Jul 06 '26 12:07

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!