乐趣区

touch-shell脚本并修改为777权限

mksh.sh

#!/bin/bash

for i in "$@"
do
        touch ${i}
        chmod 777 ${i}
        echo "#!/bin/bash">${i}
done

mkcpptest.sh

#!/bin/bash

for i in "$@"
do
        touch ${i}
        echo '#include<iostream>
#include<ctime>

using namespace std;

int main(int argc, char** argv){return 0;}'>${i}
done
# 创建
cppF=time;./mkcpptest.sh ${cppF}.cpp &&vi ${cppF}.cpp;g++ -g ${cppF}.cpp -o ${cppF}.out
#不创建
cppF=time;vi ${cppF}.cpp;g++ -g ${cppF}.cpp -o ${cppF}.out
退出移动版