c文件无法在ssh中执行

c-file cannot be execute in ssh

我使用 remote-ssh 在 vsc 上工作。在本地代码工作正常,但在 ssh 中我只能编译代码 (gcc program.c -o program -std=c11) 但是当我 运行 它与 .\program

我收到错误消息:bash: .program: command not found

可能是什么原因,我该如何解决?

使用./program。在 Bash 和 Unix 系统中,分隔文件系统组件的字符通常是正斜杠“/”。反斜杠“\”用于“转义”字符的正常用途,并按字面意思对待字符。所以 \p 说把“p”当作一个普通的“p”,它已经是了。所以 .\program 等价于 .program,它请求 shell 执行名为 .program 的文件。由于没有这样的文件,它给你一个错误信息。