Compare strings inside in the two different directories using array
问题 I don't get the scenario of this given code. All I wanted is to compare the files that is given below. But, in this script nothings happen. I assume that this given code can executed wherever like in /root and it will run. Please check this out. #!/bin/bash for file in /var/files/sub/old/* do # Strip path from file name file="${file##*/}" # Strip everything after the first hyphen prefix="${file%%-*}-" # Strip everything before the second-to-last dot suffix="$(echo $file | awk -F. '{ print "."