Quantcast
Channel: User Thomas - Ask Ubuntu
Viewing all articles
Browse latest Browse all 41

Answer by Thomas for How to pass a pathname with a space in it to cd inside of a script

$
0
0

You should use double-quotes " to surround files, folders or variables that contain special characters or whitespace.

From the example you provided, that would be as follows:

~$ mkdir "temp space"~$ temp=$(echo "temp space")~$ echo "$temp"temp space~$ cd "$temp"temp space$ 

Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>