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
相關文章
相關標籤/搜索