나는 우분투 16.04를 사용하고 있습니다. 나는 Sublime Text 3을 사용하며, C++ 프로그램을 컴파일하여 터미널에서 실행할 수 있습니다. 다음은 스크립트입니다.숭고한 텍스트 3 - 터미널에 C++ 프로그램 (경로에 공백 포함)을 컴파일하고 실행하십시오.
{
"cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++, source.cxx, source.cpp",
"variants":
[
{
"name": "RunInShell",
"shell": true,
"cmd": ["gnome-terminal -e 'bash -c \"${file_path}/${file_base_name};echo; echo Press ENTER to continue; read line;exit; exec bash\"'"]
}
]
}
하지만, C의 경로 ++ 프로그램이 공간을 (/algorithms/Search in Rotated Sorted Array
을 같은)를 포함, 스크립트가 작동하지 않습니다!
bash: /media/algorithms/Search: No such file or directory
은 RunInShell을 사용할 때 터미널에 표시됩니다.
작은 따옴표 삽입과 같이 스크립트를 수정하려고합니다.
"cmd": ["gnome-terminal -e 'bash -c \"'${file_path}/${file_base_name}';echo; echo Press ENTER to continue; read line;exit; exec bash\"'"]
그러나 그것은 작동하지 않습니다.
잘 작동하도록 스크립트를 수정하는 방법을 알고 싶습니다.
'$ {file_path}/$ {file_base_name} '부분에 추가 인용이 필요합니다. –
귀하의 아이디어는 맞지만이 부분의 추가 인용문은 앞 인용문과 일치합니다. 따라서 작동하지 않습니다. – luckcul