Using diff to compare the output of two commands Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionHow to compare two different files line by line in unix?How to emulate Process Substitution in Dash?Diff the output of two `awk` commandshow to use patch and diff to merge two filesdiff two directories for changes and format output to use for scriptDiff tool with nice output like kdiff3How to color diff output?Comparing directories using diffCompare two files, while overriding second file's sizeHow to upload a file and then check it and run some other commands using only ssh, cat, and diff in a single SSH session?STDOUT + STDERR output … is there any difference between considering the output to be an empty string vs NULLDiff between two csv files based on the column

How often does castling occur in grandmaster games?

Is there hard evidence that the grant peer review system performs significantly better than random?

Strange behavior of Object.defineProperty() in JavaScript

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

Search between two dates with specific time with each date

Time to Settle Down!

draw dynamic circle around node and edges

How many time did Arya actually used needle?

Belief In God or Knowledge Of God. Which is better?

Project Euler #1 in C++

What order were files/directories outputted in dir?

How come Sam didn't become Lord of Horn Hill?

How do I find out the mythology and history of my Fortress?

Do wooden building fires get hotter than 600°C?

How fail-safe is nr as stop bytes?

Can you explain what "processes and tools" means in the first Agile principle?

How to draw/optimize this graph with tikz

Aligning an equation at multiple points, with both left and right alignment, as well as equals sign alignment

Effects on objects due to a brief relocation of massive amounts of mass

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

How to dry out epoxy resin faster than usual?

How to compare two different files line by line in unix?

Significance of Cersei's obsession with elephants?



Using diff to compare the output of two commands



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionHow to compare two different files line by line in unix?How to emulate Process Substitution in Dash?Diff the output of two `awk` commandshow to use patch and diff to merge two filesdiff two directories for changes and format output to use for scriptDiff tool with nice output like kdiff3How to color diff output?Comparing directories using diffCompare two files, while overriding second file's sizeHow to upload a file and then check it and run some other commands using only ssh, cat, and diff in a single SSH session?STDOUT + STDERR output … is there any difference between considering the output to be an empty string vs NULLDiff between two csv files based on the column



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















How does one go about using diff to compare the output of two commands?



I know how to use it to compare the contents of a file filename1 with the output of a command cmd2:



cmd | diff filename -


How do I make it so that I can have another command, say cmd1 in place of filename?



I'm using dash, which doesn't support process substitution.










share|improve this question









New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2





    with process substitution diff <(cmd1) <(cmd2).

    – mosvy
    Apr 15 at 2:29











  • related unix.stackexchange.com/q/310500/72456

    – αғsнιη
    Apr 15 at 9:40

















2















How does one go about using diff to compare the output of two commands?



I know how to use it to compare the contents of a file filename1 with the output of a command cmd2:



cmd | diff filename -


How do I make it so that I can have another command, say cmd1 in place of filename?



I'm using dash, which doesn't support process substitution.










share|improve this question









New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2





    with process substitution diff <(cmd1) <(cmd2).

    – mosvy
    Apr 15 at 2:29











  • related unix.stackexchange.com/q/310500/72456

    – αғsнιη
    Apr 15 at 9:40













2












2








2


1






How does one go about using diff to compare the output of two commands?



I know how to use it to compare the contents of a file filename1 with the output of a command cmd2:



cmd | diff filename -


How do I make it so that I can have another command, say cmd1 in place of filename?



I'm using dash, which doesn't support process substitution.










share|improve this question









New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












How does one go about using diff to compare the output of two commands?



I know how to use it to compare the contents of a file filename1 with the output of a command cmd2:



cmd | diff filename -


How do I make it so that I can have another command, say cmd1 in place of filename?



I'm using dash, which doesn't support process substitution.







diff stdout dash






share|improve this question









New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Apr 15 at 9:32









Stephen Kitt

182k25419497




182k25419497






New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 15 at 1:08









user347221user347221

573




573




New contributor




user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user347221 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 2





    with process substitution diff <(cmd1) <(cmd2).

    – mosvy
    Apr 15 at 2:29











  • related unix.stackexchange.com/q/310500/72456

    – αғsнιη
    Apr 15 at 9:40












  • 2





    with process substitution diff <(cmd1) <(cmd2).

    – mosvy
    Apr 15 at 2:29











  • related unix.stackexchange.com/q/310500/72456

    – αғsнιη
    Apr 15 at 9:40







2




2





with process substitution diff <(cmd1) <(cmd2).

– mosvy
Apr 15 at 2:29





with process substitution diff <(cmd1) <(cmd2).

– mosvy
Apr 15 at 2:29













related unix.stackexchange.com/q/310500/72456

– αғsнιη
Apr 15 at 9:40





related unix.stackexchange.com/q/310500/72456

– αғsнιη
Apr 15 at 9:40










1 Answer
1






active

oldest

votes


















3














Based on How to emulate Process Substitution in Dash? (thanks αғsнιη!), adjusted for dash:



( cmd1 | ( cmd2 | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )





share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    user347221 is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512467%2fusing-diff-to-compare-the-output-of-two-commands%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Based on How to emulate Process Substitution in Dash? (thanks αғsнιη!), adjusted for dash:



    ( cmd1 | ( cmd2 | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )





    share|improve this answer





























      3














      Based on How to emulate Process Substitution in Dash? (thanks αғsнιη!), adjusted for dash:



      ( cmd1 | ( cmd2 | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )





      share|improve this answer



























        3












        3








        3







        Based on How to emulate Process Substitution in Dash? (thanks αғsнιη!), adjusted for dash:



        ( cmd1 | ( cmd2 | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )





        share|improve this answer















        Based on How to emulate Process Substitution in Dash? (thanks αғsнιη!), adjusted for dash:



        ( cmd1 | ( cmd2 | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 15 at 10:04

























        answered Apr 15 at 7:32









        Stephen KittStephen Kitt

        182k25419497




        182k25419497




















            user347221 is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            user347221 is a new contributor. Be nice, and check out our Code of Conduct.












            user347221 is a new contributor. Be nice, and check out our Code of Conduct.











            user347221 is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512467%2fusing-diff-to-compare-the-output-of-two-commands%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.