Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 163173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:31:16+00:00 2026-05-11T11:31:16+00:00

How come I can do this in bash: $ diff -u <(echo -e line1\nline2)

  • 0

How come I can do this in bash:

$ diff -u <(echo -e 'line1\nline2') <(echo -e 'line1\nline3') --- /dev/fd/63  2009-03-30 09:49:07.527272646 +0100 +++ /dev/fd/62  2009-03-30 09:49:07.527272646 +0100 @@ -1,2 +1,2 @@  line1 -line2 +line3 

i.e. I can use named pipes / process substituion to get the diff of a small chunk of text. However when I try to do it with wdiff, the diff for words, not just lines, I get no useful output

wdiff <(echo -e 'line1\nline2') <(echo -e 'line1\nline3') [--]{++} 

UPDATE: looks like there’s an existing ubuntu bug report for this: https://bugs.launchpad.net/ubuntu/+source/wdiff/+bug/160912

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:31:16+00:00Added an answer on May 11, 2026 at 11:31 am

    An strace reveals that wdiff stats the files (probably to find out their size). Since named pipes report a size of 0 it probably assumes that both files are empty and therefore equal:

     $ strace -efile wdiff -1 <(echo -e 'line1\nline2') <(echo -e 'line1\nline3') execve('/usr/bin/wdiff', ['wdiff', '-1', '/dev/fd/63', '/dev/fd/62'], [/* 44 vars */]) = 0 [snip uninteresting stuff] stat64('/dev/fd/63', {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 open('/dev/fd/63', O_RDONLY)            = 3 open('/tmp/wdiff.MzPXmH', O_RDWR|O_CREAT|O_EXCL, 0600) = 4 stat64('/dev/fd/62', {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 open('/dev/fd/62', O_RDONLY)            = 4 open('/tmp/wdiff.5nma9j', O_RDWR|O_CREAT|O_EXCL, 0600) = 5 --- SIGCHLD (Child exited) @ 0 (0) --- unlink('/tmp/wdiff.MzPXmH')             = 0 unlink('/tmp/wdiff.5nma9j')             = 0 {++}Process 27699 detached 

    Edit: also note that bash may use /dev/fd-style filenames instead of named pipes if the kernel supports it (most recent ones do, the example above shows this), but the effect is pretty much the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer take the first 100 scores, and sort them in an… May 12, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer try with numpy instead of nympy May 12, 2026 at 6:01 pm
  • Editorial Team
    Editorial Team added an answer The HttpSessionStateContainer class has ten local varaibles, so that is… May 12, 2026 at 6:01 pm

Related Questions

While working in a Java app, I recently needed to assemble a comma-delimited list
After reading a few related questions I've decided to use the tpl library to
I asked a still unanswered question that will shed more light on this question.
I know NTEXT is going away and that there are larger best-practices issues here

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.