[英]shell script in unix(in bash shell) for copying a file from one location(i.e a directory), to other, without using cp command at all
Can anyone help me with a shell script in unix(in bash shell) for copying a file from one location(ie a directory), to other, without using cp command at all(not using it in the script also.Any other command /utility can be used in the script).Can it be really done ? 任何人都可以在unix(在bash shell中)中使用Shell脚本来帮助我,以将文件从一个位置(即目录)复制到另一个位置,而根本不使用cp命令(也没有在脚本中使用它)。任何其他命令/实用程序可以在脚本中使用)。真的可以完成吗? I could'nt find a way out.Any help would be appreciated...
我找不到出路,任何帮助将不胜感激...
Presumably you can cat
and redirect the output. 大概您可以
cat
并重定向输出。 Since this sounds like homework, I'll leave it to you to work out the exact syntax. 由于这听起来像作业,所以我将把它留给您来确定确切的语法。
How many options do you want? 您想要几个选择?
That is nowhere near exhaustive. 那还远远不够。 You can be creative...have fun!
您可以发挥创造力……玩得开心!
You could use: 您可以使用:
cat
to create a C source file, copy.c cat
创建一个C源文件copy.c make
or cc
to compile it make
或cc
进行编译 You could use: 您可以使用:
But that is probably cheating. 但这可能是作弊。
Erghm. 嗯 Why?!
为什么?! Anyway...
无论如何...
cat file1 > some/other/dir/file2
install
是一个很好的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.