我是unix的新手,需要一些帮助.我在两个不同的服务器上有两个目录.两个目录都包含相同的文件.现在我想检查两个目录中的所有文件是否同步.如果文件不同步,那么我只想显示这些文件的名称.当目录在同一台服务器上时,我能够做到这一点.当目录存在于两个不同的服务器上时,无法弄清楚如何执行此操作.
eg:
server1 /abc/home/sample1/
server2 /abc/home/sample2/
Run Code Online (Sandbox Code Playgroud)
这里我只希望文件名不同步时显示.
提前致谢
我有一个sample.ear文件,我想替换sample.ear中的特定文件.
consider ear file sample.ear which content com1/test1/file1.sh and com2/file2.sh
Run Code Online (Sandbox Code Playgroud)
在这里,我想使用unix将file1.sh替换为更新的文件file1.sh.
我正在使用jar命令,但我无法替换子目录中的文件
谢谢
我是perl的新手.目前我正在运行一个perl脚本,它将调用另一个perl脚本.第二个perl脚本有2个输入参数
sample2.pl -itest.txt -ffile1.txt
Run Code Online (Sandbox Code Playgroud)
我有不同的输入参数-f一样file1,file2,file3...file10.
现在我想为当前运行的所有输入参数(file1,file2,file3)并行运行第二个perl脚本 -
#!/usr/bin/perl
use warnings;
use strict;
my $fi="output3.txt";--(output3.txt will contain the files file1,file2..file10)
open (OF, $fi);
foreach(<OF>)
{
system ("perl ucm3.pl -iinput.txt -f$_ ");
print $_;
}
Run Code Online (Sandbox Code Playgroud)
但它并非并行运行,而是一个接一个地运行.请帮助平行运行这些脚本.提前致谢.