awk columns to rows break for new lineConvert two rows to two columnsAdding entries to the end of a row via awkAWK sum every two rowsHow to add “wrappers” around methods in source code based on a pattern, using sed, awk, grep and friendsmerge duplicate rows in columnsConvert rows to columnsTransposing rows into columns in absence of few rows using AWKSubset rows with awkRearranging columns using awkhow to concatenate columns with multiple rows using awk

Rationale to prefer local variables over instance variables?

Are small insurances worth it?

Limpar string com Regex

What can I do if someone tampers with my SSH public key?

Precision notation for voltmeters

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Was it really inappropriate to write a pull request for the company I interviewed with?

An Undercover Army

How can I have x-axis ticks that show ticks scaled in powers of ten?

Issue with units for a rocket nozzle throat area problem

3.5% Interest Student Loan or use all of my savings on Tuition?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

What does *dead* mean in *What do you mean, dead?*?

If nine coins are tossed, what is the probability that the number of heads is even?

Short SF story. Females use stingers to implant eggs in yearfathers

How to educate team mate to take screenshots for bugs with out unwanted stuff

Should we avoid writing fiction about historical events without extensive research?

Why does a car's steering wheel get lighter with increasing speed

A running toilet that stops itself

Why is there an extra space when I type "ls" on the Desktop?

Why aren't there more Gauls like Obelix?

Can I challenge the interviewer to give me a proper technical feedback?

Giving a career talk in my old university, how prominently should I tell students my salary?

Cycles on the torus



awk columns to rows break for new line


Convert two rows to two columnsAdding entries to the end of a row via awkAWK sum every two rowsHow to add “wrappers” around methods in source code based on a pattern, using sed, awk, grep and friendsmerge duplicate rows in columnsConvert rows to columnsTransposing rows into columns in absence of few rows using AWKSubset rows with awkRearranging columns using awkhow to concatenate columns with multiple rows using awk













0















In my stats.txt page I have the following:



Get-VMHardDiskDrive | Select-Object Path

ComputerName : ACD-VMH04
Path : D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
VhdFormat : VHD
VhdType : Dynamic
Used Space : .07
Prov Space : 4.00

ComputerName : ACD-VMH04
Path : D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
VhdFormat : VHD
VhdType : Dynamic
Used Space : 258.04
Prov Space : 906.34


I run the following AWK command to give me this:



ACD-VMH04
D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
VHD
Dynamic
.07
4.00

ACD-VMH04
D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
VHD
Dynamic
258.04
906.34


The file has about 6 items like that however other files have more so I am wondering how to get the output to look like this:



ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00
ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34


This will somewhat do the job however I do not know how to tell it stop and make a new line when it hits a blank line.



awk -F " : " ' ORS = " " /Select-Object Path/ output = 1; start = NR + 2 ; output && NR >= start print $2, "-" ' stats.txt









share|improve this question




























    0















    In my stats.txt page I have the following:



    Get-VMHardDiskDrive | Select-Object Path

    ComputerName : ACD-VMH04
    Path : D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
    VhdFormat : VHD
    VhdType : Dynamic
    Used Space : .07
    Prov Space : 4.00

    ComputerName : ACD-VMH04
    Path : D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
    VhdFormat : VHD
    VhdType : Dynamic
    Used Space : 258.04
    Prov Space : 906.34


    I run the following AWK command to give me this:



    ACD-VMH04
    D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
    VHD
    Dynamic
    .07
    4.00

    ACD-VMH04
    D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
    VHD
    Dynamic
    258.04
    906.34


    The file has about 6 items like that however other files have more so I am wondering how to get the output to look like this:



    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00
    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34


    This will somewhat do the job however I do not know how to tell it stop and make a new line when it hits a blank line.



    awk -F " : " ' ORS = " " /Select-Object Path/ output = 1; start = NR + 2 ; output && NR >= start print $2, "-" ' stats.txt









    share|improve this question


























      0












      0








      0








      In my stats.txt page I have the following:



      Get-VMHardDiskDrive | Select-Object Path

      ComputerName : ACD-VMH04
      Path : D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
      VhdFormat : VHD
      VhdType : Dynamic
      Used Space : .07
      Prov Space : 4.00

      ComputerName : ACD-VMH04
      Path : D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
      VhdFormat : VHD
      VhdType : Dynamic
      Used Space : 258.04
      Prov Space : 906.34


      I run the following AWK command to give me this:



      ACD-VMH04
      D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
      VHD
      Dynamic
      .07
      4.00

      ACD-VMH04
      D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
      VHD
      Dynamic
      258.04
      906.34


      The file has about 6 items like that however other files have more so I am wondering how to get the output to look like this:



      ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00
      ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34


      This will somewhat do the job however I do not know how to tell it stop and make a new line when it hits a blank line.



      awk -F " : " ' ORS = " " /Select-Object Path/ output = 1; start = NR + 2 ; output && NR >= start print $2, "-" ' stats.txt









      share|improve this question
















      In my stats.txt page I have the following:



      Get-VMHardDiskDrive | Select-Object Path

      ComputerName : ACD-VMH04
      Path : D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
      VhdFormat : VHD
      VhdType : Dynamic
      Used Space : .07
      Prov Space : 4.00

      ComputerName : ACD-VMH04
      Path : D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
      VhdFormat : VHD
      VhdType : Dynamic
      Used Space : 258.04
      Prov Space : 906.34


      I run the following AWK command to give me this:



      ACD-VMH04
      D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd
      VHD
      Dynamic
      .07
      4.00

      ACD-VMH04
      D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd
      VHD
      Dynamic
      258.04
      906.34


      The file has about 6 items like that however other files have more so I am wondering how to get the output to look like this:



      ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00
      ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34


      This will somewhat do the job however I do not know how to tell it stop and make a new line when it hits a blank line.



      awk -F " : " ' ORS = " " /Select-Object Path/ output = 1; start = NR + 2 ; output && NR >= start print $2, "-" ' stats.txt






      text-processing awk






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 30 '17 at 21:13









      Stephen Rauch

      3,344101428




      3,344101428










      asked Mar 30 '17 at 20:02









      Anthony FornitoAnthony Fornito

      1085




      1085




















          3 Answers
          3






          active

          oldest

          votes


















          2














          I don't have a one liner for you, but the key concept here is to store the field until you have collected them all, then print them on one line. Also a blank line will have the number of fields (NF) equal to zero.



          Code:



          #!/bin/awk -f
          BEGIN FS = " : "; OFS = " - "
          NF > 0
          gsub(/[ ]+$/, "", $1)
          a[$1] = $2


          NF == 0 dump()

          END dump()

          function dump()
          print a["ComputerName"], a["Path"], a["VhdFormat"], a["VhdType"]



          Results:



          ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic
          ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic





          share|improve this answer






























            1














            perl -lne '
            /Select-Object Path/ and !$a++ and <>,next;

            /^ComputerNames+:/ && $a .. /^$/ || eof and do /./;
            print join(" - ", splice(@A,0,@A)),"n" if /^$/ ;

            ' stats.txt


            Output



            ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00

            ACD-VMH05 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34





            share|improve this answer
































              0














              We can use " : " as delimter and print 2nd field of every line in awk




              awk -v FS=" : " -v ORS="" 'print $2,"- "; if ( $0 ~ /^$/) print "n"' stats.txt






              share|improve this answer








              New contributor




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



















                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
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f354922%2fawk-columns-to-rows-break-for-new-line%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                2














                I don't have a one liner for you, but the key concept here is to store the field until you have collected them all, then print them on one line. Also a blank line will have the number of fields (NF) equal to zero.



                Code:



                #!/bin/awk -f
                BEGIN FS = " : "; OFS = " - "
                NF > 0
                gsub(/[ ]+$/, "", $1)
                a[$1] = $2


                NF == 0 dump()

                END dump()

                function dump()
                print a["ComputerName"], a["Path"], a["VhdFormat"], a["VhdType"]



                Results:



                ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic
                ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic





                share|improve this answer



























                  2














                  I don't have a one liner for you, but the key concept here is to store the field until you have collected them all, then print them on one line. Also a blank line will have the number of fields (NF) equal to zero.



                  Code:



                  #!/bin/awk -f
                  BEGIN FS = " : "; OFS = " - "
                  NF > 0
                  gsub(/[ ]+$/, "", $1)
                  a[$1] = $2


                  NF == 0 dump()

                  END dump()

                  function dump()
                  print a["ComputerName"], a["Path"], a["VhdFormat"], a["VhdType"]



                  Results:



                  ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic
                  ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic





                  share|improve this answer

























                    2












                    2








                    2







                    I don't have a one liner for you, but the key concept here is to store the field until you have collected them all, then print them on one line. Also a blank line will have the number of fields (NF) equal to zero.



                    Code:



                    #!/bin/awk -f
                    BEGIN FS = " : "; OFS = " - "
                    NF > 0
                    gsub(/[ ]+$/, "", $1)
                    a[$1] = $2


                    NF == 0 dump()

                    END dump()

                    function dump()
                    print a["ComputerName"], a["Path"], a["VhdFormat"], a["VhdType"]



                    Results:



                    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic
                    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic





                    share|improve this answer













                    I don't have a one liner for you, but the key concept here is to store the field until you have collected them all, then print them on one line. Also a blank line will have the number of fields (NF) equal to zero.



                    Code:



                    #!/bin/awk -f
                    BEGIN FS = " : "; OFS = " - "
                    NF > 0
                    gsub(/[ ]+$/, "", $1)
                    a[$1] = $2


                    NF == 0 dump()

                    END dump()

                    function dump()
                    print a["ComputerName"], a["Path"], a["VhdFormat"], a["VhdType"]



                    Results:



                    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic
                    ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 30 '17 at 20:43









                    Stephen RauchStephen Rauch

                    3,344101428




                    3,344101428























                        1














                        perl -lne '
                        /Select-Object Path/ and !$a++ and <>,next;

                        /^ComputerNames+:/ && $a .. /^$/ || eof and do /./;
                        print join(" - ", splice(@A,0,@A)),"n" if /^$/ ;

                        ' stats.txt


                        Output



                        ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00

                        ACD-VMH05 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34





                        share|improve this answer





























                          1














                          perl -lne '
                          /Select-Object Path/ and !$a++ and <>,next;

                          /^ComputerNames+:/ && $a .. /^$/ || eof and do /./;
                          print join(" - ", splice(@A,0,@A)),"n" if /^$/ ;

                          ' stats.txt


                          Output



                          ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00

                          ACD-VMH05 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34





                          share|improve this answer



























                            1












                            1








                            1







                            perl -lne '
                            /Select-Object Path/ and !$a++ and <>,next;

                            /^ComputerNames+:/ && $a .. /^$/ || eof and do /./;
                            print join(" - ", splice(@A,0,@A)),"n" if /^$/ ;

                            ' stats.txt


                            Output



                            ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00

                            ACD-VMH05 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34





                            share|improve this answer















                            perl -lne '
                            /Select-Object Path/ and !$a++ and <>,next;

                            /^ComputerNames+:/ && $a .. /^$/ || eof and do /./;
                            print join(" - ", splice(@A,0,@A)),"n" if /^$/ ;

                            ' stats.txt


                            Output



                            ACD-VMH04 - D:HYPER-VVMDEV01Virtual Hard Disksf9314d7d-5d2d-11e0-8feb-806e6f6e6963_2012-06-29T153327.vhd - VHD - Dynamic - .07 - 4.00

                            ACD-VMH05 - D:HYPER-VVMDEV01Virtual Hard DisksC_2012-06-29T153327.vhd - VHD - Dynamic - 258.04 - 906.34






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 30 '17 at 21:58

























                            answered Mar 30 '17 at 21:36







                            user218374




























                                0














                                We can use " : " as delimter and print 2nd field of every line in awk




                                awk -v FS=" : " -v ORS="" 'print $2,"- "; if ( $0 ~ /^$/) print "n"' stats.txt






                                share|improve this answer








                                New contributor




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
























                                  0














                                  We can use " : " as delimter and print 2nd field of every line in awk




                                  awk -v FS=" : " -v ORS="" 'print $2,"- "; if ( $0 ~ /^$/) print "n"' stats.txt






                                  share|improve this answer








                                  New contributor




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






















                                    0












                                    0








                                    0







                                    We can use " : " as delimter and print 2nd field of every line in awk




                                    awk -v FS=" : " -v ORS="" 'print $2,"- "; if ( $0 ~ /^$/) print "n"' stats.txt






                                    share|improve this answer








                                    New contributor




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










                                    We can use " : " as delimter and print 2nd field of every line in awk




                                    awk -v FS=" : " -v ORS="" 'print $2,"- "; if ( $0 ~ /^$/) print "n"' stats.txt







                                    share|improve this answer








                                    New contributor




                                    Deepu 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 answer



                                    share|improve this answer






                                    New contributor




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









                                    answered 1 hour ago









                                    DeepuDeepu

                                    12




                                    12




                                    New contributor




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





                                    New contributor





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






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



























                                        draft saved

                                        draft discarded
















































                                        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%2f354922%2fawk-columns-to-rows-break-for-new-line%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

                                        Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

                                        Nikolai Prilezhaev Bibliography References External links Navigation menuEarly Russian Organic Chemists and Their Legacy092774english translationRussian Biography

                                        How to link a C library to an Assembly library on Mac with clangHow do you set, clear, and toggle a single bit?Find (and kill) process locking port 3000 on MacWho is listening on a given TCP port on Mac OS X?How to start PostgreSQL server on Mac OS X?Compile assembler in nasm on mac osHow do I install pip on macOS or OS X?AFNetworking 2.0 “_NSURLSessionTransferSizeUnknown” linking error on Mac OS X 10.8C++ code for testing the Collatz conjecture faster than hand-written assembly - why?How to link a NASM code and GCC in Mac OS X?How to run x86 .asm on macOS Sierra