Handling directories with white spaces in bash script
Hey all, I'm new to bash-scripting and trying to write a script which involves calling a command with a string stored as a variable, which is a directory path that contains whitespaces.
For example, consider the following very simple script; Code:
#! /bin/bash Code:
./test.sh Code:
ls ./this\ is\ a\ test\ dir/ Thanks! |
You need to quote it when it's used
Code:
$ path=this\ is\ a\ test |
Ah, I tried that but I guess you can't use the '\ ' delimiters and quotes at the same time... thanks!
|
All times are GMT -5. The time now is 04:57 AM. |