A bash loop to echo all possible ASCII characters [closed]









up vote
-3
down vote

favorite












I know how to print all letters




a..z and A..Z and 0..9




But is there a way to print all possible ASCII Characters via a bash loop?










share|improve this question













closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 2




    Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
    – Cyrus
    Nov 10 at 8:54







  • 1




    Try man ascii
    – Mark Setchell
    Nov 10 at 10:05






  • 1




    See also stackoverflow.com/a/48905712/2836621
    – Mark Setchell
    Nov 10 at 10:08










  • I meant regular ASCII (0-127)
    – Gautham Varma Kanumuru
    Nov 11 at 8:11














up vote
-3
down vote

favorite












I know how to print all letters




a..z and A..Z and 0..9




But is there a way to print all possible ASCII Characters via a bash loop?










share|improve this question













closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 2




    Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
    – Cyrus
    Nov 10 at 8:54







  • 1




    Try man ascii
    – Mark Setchell
    Nov 10 at 10:05






  • 1




    See also stackoverflow.com/a/48905712/2836621
    – Mark Setchell
    Nov 10 at 10:08










  • I meant regular ASCII (0-127)
    – Gautham Varma Kanumuru
    Nov 11 at 8:11












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I know how to print all letters




a..z and A..Z and 0..9




But is there a way to print all possible ASCII Characters via a bash loop?










share|improve this question













I know how to print all letters




a..z and A..Z and 0..9




But is there a way to print all possible ASCII Characters via a bash loop?







linux bash gnome-terminal






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 8:44









Gautham Varma Kanumuru

11




11




closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by jww, Madhur Bhaiya, dandan78, rene, Robert Columbia Nov 10 at 12:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
    – Cyrus
    Nov 10 at 8:54







  • 1




    Try man ascii
    – Mark Setchell
    Nov 10 at 10:05






  • 1




    See also stackoverflow.com/a/48905712/2836621
    – Mark Setchell
    Nov 10 at 10:08










  • I meant regular ASCII (0-127)
    – Gautham Varma Kanumuru
    Nov 11 at 8:11












  • 2




    Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
    – Cyrus
    Nov 10 at 8:54







  • 1




    Try man ascii
    – Mark Setchell
    Nov 10 at 10:05






  • 1




    See also stackoverflow.com/a/48905712/2836621
    – Mark Setchell
    Nov 10 at 10:08










  • I meant regular ASCII (0-127)
    – Gautham Varma Kanumuru
    Nov 11 at 8:11







2




2




Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54





Define "all possible ASCII Characters". 0-127 or extended ASCII 0-255? What about the non-printable characters?
– Cyrus
Nov 10 at 8:54





1




1




Try man ascii
– Mark Setchell
Nov 10 at 10:05




Try man ascii
– Mark Setchell
Nov 10 at 10:05




1




1




See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08




See also stackoverflow.com/a/48905712/2836621
– Mark Setchell
Nov 10 at 10:08












I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11




I meant regular ASCII (0-127)
– Gautham Varma Kanumuru
Nov 11 at 8:11












3 Answers
3






active

oldest

votes

















up vote
2
down vote













You don't need a loop



echo -e \x0..70..9,A..F


It prints all chars from 0 to 127.






share|improve this answer





























    up vote
    2
    down vote













    If it is okay to use awk:



    awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'


    Or using printf:



    for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done





    share|improve this answer





























      up vote
      1
      down vote













      use this:



      for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"





      share|improve this answer



























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        2
        down vote













        You don't need a loop



        echo -e \x0..70..9,A..F


        It prints all chars from 0 to 127.






        share|improve this answer


























          up vote
          2
          down vote













          You don't need a loop



          echo -e \x0..70..9,A..F


          It prints all chars from 0 to 127.






          share|improve this answer
























            up vote
            2
            down vote










            up vote
            2
            down vote









            You don't need a loop



            echo -e \x0..70..9,A..F


            It prints all chars from 0 to 127.






            share|improve this answer














            You don't need a loop



            echo -e \x0..70..9,A..F


            It prints all chars from 0 to 127.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 23 at 6:25

























            answered Nov 10 at 11:24









            oguzismail

            2,5642821




            2,5642821






















                up vote
                2
                down vote













                If it is okay to use awk:



                awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'


                Or using printf:



                for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done





                share|improve this answer


























                  up vote
                  2
                  down vote













                  If it is okay to use awk:



                  awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'


                  Or using printf:



                  for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done





                  share|improve this answer
























                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    If it is okay to use awk:



                    awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'


                    Or using printf:



                    for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done





                    share|improve this answer














                    If it is okay to use awk:



                    awk 'BEGINfor (i=32;i<127;i++) printf("%c", i)'


                    Or using printf:



                    for((i=32;i<127;i++)) do printf "x$(printf %x $i)"; done






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 30 at 9:52

























                    answered Nov 10 at 9:27









                    ssemilla

                    2,687423




                    2,687423




















                        up vote
                        1
                        down vote













                        use this:



                        for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"





                        share|improve this answer
























                          up vote
                          1
                          down vote













                          use this:



                          for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"





                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            use this:



                            for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"





                            share|improve this answer












                            use this:



                            for ((i=32;i<127;i++)) do printf "\$(printf %03o "$i")"; done;printf "n"






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 10 at 9:10









                            mahradbt

                            1389




                            1389













                                Popular posts from this blog

                                How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

                                Syphilis

                                Darth Vader #20