How do you strip quotes out of an ECHO'ed string in a Windows batch file?

后端 未结 12 1872
萌比男神i
萌比男神i 2020-12-05 04:23

I have a Windows batch file I\'m creating, but I have to ECHO a large complex string, so I\'m having to put double quotes on either end. The problem is that the quotes are

12条回答
  •  一向
    一向 (楼主)
    2020-12-05 05:05

    Brute force method:

    echo "foo <3 bar" | sed -e 's/\(^"\|"$\)//g'
    

    This requires finding a suitable Win32 version of sed, of course.

提交回复
热议问题