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

4次阅读

共计 364 个字符,预计需要花费 1 分钟才能阅读完成。

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
正文完
 0