我搜索了互联网,但也许我使用了错误的关键字,但我找不到下面这个非常简单的问题的语法:
如何将文件作为命令行参数重定向到 Linux 命令“touch”?我想创建一个带有“touch abc.txt”的文件,但文件名应该来自包含“abc.txt”的文件名“file.txt”,而不是手动输入。
[root@machine ~]# touch < file.txt
touch: missing file operand
Try `touch --help' for more information.
[root@machine ~]# cat file.txt
abc.txt
Run Code Online (Sandbox Code Playgroud)