简体   繁体   中英

Can't run files in Bash in Visual Studio

Error Message:

在此处输入图像描述

$ bash: cd: c:\Users\Antonio\Desktop\Projects\Work\Present" && g++ dar.cpp -o dar && c:UsersAntonio
DesktopProjectsWorkPresent"dar: No such file or directorycd "c:\Users\Antonio\Desktop\Projects\Work
\Present\" && g++ dar.cpp -o dar && "c:\Users\Antonio\Desktop\Projects\Work\Present\"dar
bash: bash:: command not found 

I just don't get why it's showing this error if the file exists over there. I can freely compile and run it with PowerShell, but when I use Bash I get the error.

I am currently using Visual Studio Code with Code Runner. I also couldn't find anything substantial about my problem in Google so I hope I'm in the right place.

The colon after the word bash (or cd) is not needed. It think you want to run bash: (it should be bash). It can't find a command called bash: , so it throws the error.

For example, on my computer:

mamuns-computer:~ xmrashid$ bash:
-bash: bash:: command not found
mamuns-computer:~ xmrashid$ bash
bash-5.0$ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM