-3

I have a bash project, which consists a dozen files. There are some copy paste between the files (and inside one files also).

So, is there a copy paste detector for bash / shell scripts or at least for plain text?


Copy paste detector, like this, just for shell script: http://pmd.sourceforge.net/pmd-5.1.0/cpd.html

Similar question for java: Do tools exist which automatically find copy-and-paste code?

Community
  • 1
  • 1
pihentagy
  • 5,975
  • 9
  • 39
  • 58

2 Answers2

0

This is what comm is for:

comm -12 <(sort file1.txt) <(sort file2.txt)
Josh Jolly
  • 11,258
  • 2
  • 39
  • 55
0

I've been searching for this myself. Here are some of the results I've found that either claim they do plain text, or someone else claims they do plain text.

MOSS

Clone Dr

Simian

Near Dup

I've also run into some others, such as DuDe (exists several places) and CCfinder but I can't get either of them to compile.

I only post anonymously, so I don't have enough rep to post more than two links, sorry.

Edit: Atomiq worked for me on plain text, that will probably be my go to now