2
votes
2answers
255 views

bash and arithmetic comparison: double quotes or not?

when comparing two integers in bash, do we have to put double quotes ? In the official document http://tldp.org/LDP/abs/html/comparison-ops.html I can read that double quotes should appear every ...
1
vote
1answer
186 views

Check for duplicate files in two collections, ignoring duplicates within A

I have four similar large collections of website files. They are archived copies of a similar directory tree from different times in the past. I want to merge them all to the most recent collection, ...
1
vote
3answers
2k views

md5sum of files in two folders

I'm trying to compare all the files in two folders via an md5sum in one command. Some like the following (bash) in Debian: $ cd ~/FOLDER1 $ md5sum ~/FOLDER2/* | md5sum -c - The idea is that the ...
3
votes
3answers
122 views

What's going on with my 'if' comparison in bash?

bash input: if [[ 167 > 10800 ]] then echo "I can't compare" fi bash output: I can't compare I guess the question is pretty obvious...
7
votes
4answers
9k views

How to compare file timestamps in bash?

How do I compare the timestamp of two files? I tried this but it doesn't work: file1time=`stat -c %Y fil1.txt` file2time=`stat -c %Y file2.txt` if[$file1time -gt $file2time]; then doSomething fi ...