in reply to Escape special chars in a path
bash quoting is simple: put single quotes around the string after replacing every ' in the string with '"'"'
sub bashquote { "'" . shift =~ s/'/'"'"'/gr . "'" }
Sure, sometimes the wrapping single quotes are not needed, but if they are just around directory names and file names, they don't hurt.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Escape special chars in a path
by afoken (Chancellor) on Aug 21, 2022 at 10:23 UTC |