Script 3 - C/C++ Code Body Template File Maker I often complain that I need to make a script or a macro to setup the skeleton of a C/C++ code file for me since I get tired of typing it every single time.
Create a script that takes a -c or -cpp and creates a C or C++ template file. If the user dosen't provide -c or -cpp then give them a usage error.
Use Cases: ./cBodyMaker.sh <-C]-cpp>
Examples: ./ cBodyMaker.sh -C
Output:
#include #include int main(int argc, char** argv) { //TODO: Code goes here return 0; } ./ cBodyMaker.sh -cpp
Output:
#include #include using std::cout; using std::cin; using std::endl; int main(int argc, char** argv) { //TODO: Main code return 0; } ./cBodyMaker.sh Output: usage: ./cBodyMaker.sh [-cl-cpp]