Should I set the locale to `C` when matching a range of numbers?Escaping * with Regular Expressions and...

Is one obligated to listen to a Rav?

Why doesn't the Earth's acceleration towards the Moon accumulate to push the Earth off its orbit?

Is there a general effective method to solve Smullyan style Knights and Knaves problems? Is the truth table method the most appropriate one?

When did God say "let all the angels of God worship him" as stated in Hebrews 1:6?

Under what law can the U.S. arrest International Criminal Court (ICC) judges over war crimes probe?

Full backup on database creation

Does this degree 12 genus 1 curve have only one point over infinitely many finite fields?

Crossing US border with music files I'm legally allowed to possess

Can you heal a summoned creature?

How can people dance around bonfires on Lag Lo'Omer - it's darchei emori?

Geological aftereffects of an asteroid impact on a large mountain range?

How were these pictures of spacecraft wind tunnel testing taken?

Why do Russians call their women expensive ("дорогая")?

What are these (utility?) boxes at the side of the house?

Canon 70D often overexposing or underexposing shots

PETG layer adhesion

If a person had control of every single cell of their body, would they be able to transform into another creature?

When and what was the first 3D acceleration device ever released?

Why is this Simple Puzzle impossible to solve?

What is the 中 in ダウンロード中?

Riley Rebuses that Share a Common Theme

How can I find where certain bash function is defined?

Is floating in space similar to falling under gravity?

I unknowingly submitted plagiarised work



Should I set the locale to `C` when matching a range of numbers?


Escaping * with Regular Expressions and GrepCommand to retrieve the list of characters in a given character class in the current localeWhy my programs use Russian instead of English as it's set in the localeLMDE2 / MATE locale charset inconsistencyHow to do a positional search in a file and find write the lines containing the matching pattern in another fileCan't load gnome-terminal on Debian Stretch, “Non UTF-8 locale is not supported!”Comparing two files linewise and if pattern of file 1 is not found (fully or partially) in file 2 then print line of file 1Why is sed failing to follow collate order?grep range of numbers in a text filewhy does recursive searching with grep print fewer lines when using bSTRINGb compared to the -w option?






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







2















If I wanted to search for lines in a file that contain a or b or c or d I would run



LC_COLLATE=C grep -E '[a-d]' file_to_search


or



LC_ALL=C grep -E '[a-d]' file_to_search


If I fail to set the locale to C in the examples above, I risk matching characters that are not a or b or c or d.



If I am searching for a range of numbers



grep -E '[1-5]' file_to_search


is it still important for me to set the locale to C?










share|improve this question





























    2















    If I wanted to search for lines in a file that contain a or b or c or d I would run



    LC_COLLATE=C grep -E '[a-d]' file_to_search


    or



    LC_ALL=C grep -E '[a-d]' file_to_search


    If I fail to set the locale to C in the examples above, I risk matching characters that are not a or b or c or d.



    If I am searching for a range of numbers



    grep -E '[1-5]' file_to_search


    is it still important for me to set the locale to C?










    share|improve this question

























      2












      2








      2








      If I wanted to search for lines in a file that contain a or b or c or d I would run



      LC_COLLATE=C grep -E '[a-d]' file_to_search


      or



      LC_ALL=C grep -E '[a-d]' file_to_search


      If I fail to set the locale to C in the examples above, I risk matching characters that are not a or b or c or d.



      If I am searching for a range of numbers



      grep -E '[1-5]' file_to_search


      is it still important for me to set the locale to C?










      share|improve this question














      If I wanted to search for lines in a file that contain a or b or c or d I would run



      LC_COLLATE=C grep -E '[a-d]' file_to_search


      or



      LC_ALL=C grep -E '[a-d]' file_to_search


      If I fail to set the locale to C in the examples above, I risk matching characters that are not a or b or c or d.



      If I am searching for a range of numbers



      grep -E '[1-5]' file_to_search


      is it still important for me to set the locale to C?







      shell posix locale pattern-matching






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 47 mins ago









      Harold FischerHarold Fischer

      703416




      703416






















          0






          active

          oldest

          votes












          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%2f521228%2fshould-i-set-the-locale-to-c-when-matching-a-range-of-numbers%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f521228%2fshould-i-set-the-locale-to-c-when-matching-a-range-of-numbers%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...