Template script for writing C ++ primer exercise questions in Linux (for example, the path is/home/ywt/SH/STD. Sh ):
The script is as follows:
#! /Bin/sh <br/> touch $1; <br/> echo "/************************"> $1; <br/> echo "* $1"> $1; <br/> echo "* yuwentao"> $1; <br/> echo "* $ (date + % Y-% m-% d + % H: % m: % s)" >>1 1; <br/> echo "**************************/"> $1; <br/> echo "# include <iostream>" >1 1; <br/> echo "# include <string>" >>1 1; <br/> echo "# include <vector>" >1 1; <br/> echo "using namespace STD;" >>1 1; <br/> echo "" >>1 1; <br/> echo "int main ()" >>1 1; <br/> echo "{" >>1 1; <br/> echo "" >>1 1; <br/> echo "Return 0;" >>>$ 1; <br/> echo "}" >>1 1; <br/>
Add the following content to the user configuration file:
Alias STD = '/home/ywt/SH/STD. Sh ';
When you create a CPP file in the future, use:
STD test. cpp
The template code is as follows:
/************************* <Br/> * test. CPP <br/> * yuwentao <br/> * + 02:13:59 <br/> ********************* * ***/<br/> # include <iostream> <br/> # include <string> <br/> # include <vector> <br/> int main () <br/>{</P> <p >}< br/>