分别用shell编程和c编程实现文件和目录的复制
c编程参考:https://blog.csdn.net/maizi_hsx/article/details/78645698
makefile文件:
1 copy:cp.o 2 gcc cp.o -o copy 3 cp.o:cp.c 4 gcc -c cp.c -o cp.o 5 clean: 6 rm -f *.o copy
运行:
shell编程:shell.sh文件
1 #!/bin/bash 2 cp -r $1/* $2/
运行:
结果: