Bash scripts are very useful and can save a lot of programming time So how do you start a bash script in a c++ program 5 i am new in bash programming I want to call my c++ program in bash file } and my bash file is mybash.sh How can i call my above.cpp program in mybash.sh file?
C shell (cpp.sh, browser based compiler) is running a program visual studio won't asked 9 years, 1 month ago modified 9 years, 1 month ago viewed 2k times Create a file with .sh extension and open it with your favorite text editor Paste this code (change compiling line with line you are using to compile your progam) #!/bin/bash #run this in terminal #+ command to compile c++ program The following example c++ project has two files I want to embed the hello_world.sh as resource file when building the project with cmake, after building the project, an executable called helloworld is generated. Asked 1 year, 4 months ago modified 1 year, 4 months ago viewed 202 times
} the trick is that your text file must be both valid c/c++ code and shell script Remember to exit from the shell script before the interpreter reaches the c/c++ code, or invoke exec magic Run with chmod +x main.c I am running ubuntu on computer 1 and computer 2 I compiled a c++ program on computer 1, and i can execute it from the terminal using./program_name However, when i try to do this on
WATCH