Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here's what I'm sure is an easy one, but I can't figure it out.

I have two files:

file1: You are in a maze of twisty little passages, all alike
file2: You are in a maze of twisty little* passages, all alike

I want to perform sdiff on these files, but I want to ignore the * character.

How do I do this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Actually, -I will ignore the whole line I think, not the character. If you want to ignore the character you can:

sdiff <(cat file1 | tr -d '*') <(cat file2 | tr -d '*')

Reference from man sdiff:

-I RE  --ignore-matching-lines=RE
              Ignore changes whose lines all match RE.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.