Created
September 16, 2021 13:52
-
-
Save Hermann-SW/0d00f9afe0c274414220ee73e3a77120 to your computer and use it in GitHub Desktop.
C++ script with bash part output "hello " and C++ part output "world"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exc=/tmp/`basename $0` | |
if [ $0 -nt $exc ]; then sed -n "/^\/\*\*$/,\$p" $0 | g++ -x c++ - -o $exc; fi | |
echo -n "hello " | |
$exc | |
exit | |
/** | |
*/ | |
#include <iostream> | |
int main() | |
{ | |
std::cout << "world" << std::endl; | |
} |
Author
Hermann-SW
commented
Sep 16, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment