If you have Python, here's a neater alternative:
Code:
#!/usr/bin/python
for line in open("file"):
line = line.strip().split(",")
if len(line) == len(set(line)):
print "No change"
else:
print ','.join(line)
output:
Code:
# ./test.py
No change
apple,mango,orange,apple,grape
unix,windows,solaris,windows,linux
No change
orange,maroon,pink,violet,orange,pink