我正试图使用wpa_cli
添加一个网络,该网络的SSID包含一个使用.sh
bash文件的空间:
wpa_cli set_network 0 ssid "SSID 123"
但"
并没有帮助——wpa_cli
仍然将空间解释为两个参数的分隔符。
看起来您混合了转义引号和转义空格。
如果参数(文件名或ssid)中有空格,可以通过两种方式转义空格:
-
使用"或"
cp "file with spaces" "path with spaces/sub dir" cp 'file with spaces' 'path with spaces/sub dir'
注意,
" "
和' '
之间存在差异。如果使用' '
,则不会展开变量。 -
用反斜杠转义空格(
)。
cp file with spaces path with spaces/sub dir