yojoc
V2EX  ›  Windows

powershell 中的转义符,真是个大麻烦

  •  
  •   yojoc · Jun 20, 2020 · 3037 views
    This topic created in 2184 days ago, the information mentioned may be changed or developed.

    今天发现在路径中含有方括号[]的文件夹里,无法用右键菜单打开自己添加的 terminal 到当前文件夹下了,而是会导向到C:\Windows\System32\WindowsPowerShell\v1.0。 通过 cd 也无法进入路径,显示该路径不存在。 网上查了查,是因为方括号要带转义字符才能识别为路径。然而找了一圈没有发现好的办法解决右键菜单这个问题,单引号 cd 也不好使。希望各位提点建议

    3 replies    2020-06-20 19:12:57 +08:00
    YetToCome
        1
    YetToCome  
       Jun 20, 2020 via Android
    ps 里 cd 是 set-location 的别名,加上-path 参数
    Osk
        2
    Osk  
       Jun 20, 2020
    cd '.\`[tmp`]\'
    Osk
        3
    Osk  
       Jun 20, 2020
    没错,单引号里面居然也要加 `,奇葩。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2770 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 12:35 · PVG 20:35 · LAX 05:35 · JFK 08:35
    ♥ Do have faith in what you're doing.