gpt4 book ai didi

batch-file - 我如何调用 concat : %variable% when the variable has internal spaces?

转载 作者:行者123 更新时间:2023-12-04 16:27:39 26 4
gpt4 key购买 nike

我正在尝试使用以下命令在我的类路径中连接变量,但是当文件夹名称包含空格时它不起作用:

call concat : %variable%

哪里 %variable% ={folder name containing space}
我试着加引号:
call concat : "%variable%"

但这在我的类路径中添加了 2 个双引号,如下所示:
""folder name containing space""

:concat
set CLASSPATH=%CLASSPATH%;"%1"

最佳答案

在整个 SET 周围加上引号陈述:

SET "FOO=AB C"
SET "BAR=%FOO%D EF"
echo %BAR%

输出:
AB CD EF

关于batch-file - 我如何调用 concat : %variable% when the variable has internal spaces?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15478002/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com