#!/bin/bash
while read server <&3; do #read server names into the while loop
if [[ ! $server =~ [^[:space:]] ]] ; then #empty line exception
continue
fi
echo "Connecting to - $server"
#ssh "$server" #SSH login
while read updatedfile <&3 && read oldfile <&4; do
echo Comparing $updatedfile with $oldfile
if diff "$updatedfile" "$oldfile" >/dev/null ; then
echo The files compared are the same. No changes were made.
else
echo The files compared are different.
# copy the new file …Run Code Online (Sandbox Code Playgroud) $fileEntries = [IO.Directory]::GetFiles("C:\Users\U0146121\Desktop\Example Data"); #where the file is located.
foreach($fileName in $fileEntries)
{
#write the file name to a text file.
}
Run Code Online (Sandbox Code Playgroud)
我需要将文件名写入循环中的文本文件,但我不知道如何.
最后,我将读取文本文件并在excel中搜索文件名.但是现在我必须首先编写.txt文件.