我想制作一个文件的多个副本,我能够像这样做...
dd if=~/learndir/source.txt | tee >(dd of=~/learndir/un.txt) | tee >(dd of=~/learndir/deux.txt) | tee >(dd of=~/learndir/trois.txt) | tee >(dd of=~/learndir/quatre.txt) | dd of=~/learndir/cinque.txt
Run Code Online (Sandbox Code Playgroud)
我的问题是,这在终端中有效,但在脚本中无效.这是一个与我尝试执行的语法相同的脚本...
#!/bin/sh
dd if=~/learndir/source.txt | tee >(dd of=~/learndir/un.txt) | tee
>(dd of=~/learndir/deux.txt) | tee >(dd of=~/learndir/trois.txt) | tee >(dd of=~/learndir/quatre.txt) | dd of=~/learndir/cinque.txt
Run Code Online (Sandbox Code Playgroud)
我收到以下错误...
~$ sh duplicate5.sh
> duplicate5.sh: 2: duplicate5.sh: Syntax error: "(" unexpected
Run Code Online (Sandbox Code Playgroud)
我不明白为什么它在我的美元提示下工作但不在脚本中.