将所有脚本输出到一个文件中
Output all scripts in one file
我有 3 个命令将输出到 3 个不同的文件。
./ant process1 > File1
./ant process3 > File2
./ant process3 > File3
如何combine/merge将这些命令输出到一个文件中?
另外,有没有办法将该输出文件重新定位到某个目录中?假设它自动保存在同一个目录下。
已编辑:正如 Rany 所指出的,子 shell 是不必要的。
另请注意,Bash 的 组命令 (即 { list; }
)必须以分号或换行符结尾。
顺序:
{./ant process1; ./ant process2; ./ant process3; } > File123
异步:
{./ant process1 & ./ant process2 & ./ant process3 & } > File123
./ant process1 > /path/to/file
./ant process2 >> /path/to/file
./ant process3 >> /path/to/file
或者
{ ./ant process1; ./ant process2; ./ant process3; } > /path/to/file
我有 3 个命令将输出到 3 个不同的文件。
./ant process1 > File1
./ant process3 > File2
./ant process3 > File3
如何combine/merge将这些命令输出到一个文件中? 另外,有没有办法将该输出文件重新定位到某个目录中?假设它自动保存在同一个目录下。
已编辑:正如 Rany 所指出的,子 shell 是不必要的。
另请注意,Bash 的 组命令 (即 { list; }
)必须以分号或换行符结尾。
顺序:
{./ant process1; ./ant process2; ./ant process3; } > File123
异步:
{./ant process1 & ./ant process2 & ./ant process3 & } > File123
./ant process1 > /path/to/file
./ant process2 >> /path/to/file
./ant process3 >> /path/to/file
或者
{ ./ant process1; ./ant process2; ./ant process3; } > /path/to/file