Home > Software design >  c-file cannot be execute in ssh
c-file cannot be execute in ssh

Time:03-15

I work on vsc with remote-ssh. On local side the code works fine, but in ssh I can only compile the code (gcc program.c -o program -std=c11) but when I run it with .\program

I get the error message: bash: .program: command not found

What could be the reason and how can I fix it?

CodePudding user response:

Use ./program. In Bash, and Unix systems generally, the character to separate file system components is the forward slash, “/”. The backward slash, “\” is used to “escape” characters normal purposes and treat the character literally. So \p says to treat “p” as an ordinary “p”, which it already is. So .\program is equivalent to .program, which requests the shell to execute a file named .program. Since there is no such file, it gives you an error message.

  • Related