How to grep '$$$$$'? [duplicate]












2















This question already has an answer here:




  • grep and escaping a dollar sign

    2 answers




I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make sure this did not cause conflicts with existing similar sequence.



However, when I grep $, I get similar number of lines. It seems that $ is a special character for end of line?



How can i search for $$$$$ using grep?
Is $ a special character?










share|improve this question















marked as duplicate by Jeff Schaller, Stephen Harris, Fabby, Sergiy Kolodyazhnyy, elbarna Dec 31 '18 at 0:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
    – dave_thompson_085
    Dec 30 '18 at 20:49
















2















This question already has an answer here:




  • grep and escaping a dollar sign

    2 answers




I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make sure this did not cause conflicts with existing similar sequence.



However, when I grep $, I get similar number of lines. It seems that $ is a special character for end of line?



How can i search for $$$$$ using grep?
Is $ a special character?










share|improve this question















marked as duplicate by Jeff Schaller, Stephen Harris, Fabby, Sergiy Kolodyazhnyy, elbarna Dec 31 '18 at 0:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
    – dave_thompson_085
    Dec 30 '18 at 20:49














2












2








2








This question already has an answer here:




  • grep and escaping a dollar sign

    2 answers




I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make sure this did not cause conflicts with existing similar sequence.



However, when I grep $, I get similar number of lines. It seems that $ is a special character for end of line?



How can i search for $$$$$ using grep?
Is $ a special character?










share|improve this question
















This question already has an answer here:




  • grep and escaping a dollar sign

    2 answers




I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make sure this did not cause conflicts with existing similar sequence.



However, when I grep $, I get similar number of lines. It seems that $ is a special character for end of line?



How can i search for $$$$$ using grep?
Is $ a special character?





This question already has an answer here:




  • grep and escaping a dollar sign

    2 answers








grep string search special-characters file-search






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 30 '18 at 17:14

























asked Dec 30 '18 at 17:02









user9371654

2507




2507




marked as duplicate by Jeff Schaller, Stephen Harris, Fabby, Sergiy Kolodyazhnyy, elbarna Dec 31 '18 at 0:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Jeff Schaller, Stephen Harris, Fabby, Sergiy Kolodyazhnyy, elbarna Dec 31 '18 at 0:15


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
    – dave_thompson_085
    Dec 30 '18 at 20:49


















  • In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
    – dave_thompson_085
    Dec 30 '18 at 20:49
















In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
– dave_thompson_085
Dec 30 '18 at 20:49




In addition, in shell unquoted $$ is a special parameter which is replaced by the PID of the shell; this is commonly (and traditionally) used to create unique/nonconflicting names for temp-files and such.
– dave_thompson_085
Dec 30 '18 at 20:49










1 Answer
1






active

oldest

votes


















18















It seems that $ is a special character for end of line?




Yep, exactly. And there's an end-of-line on each and every line.



You'll need to use $$$$$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.



Or a shorter version regex pattern: ${5} in basic regex or ${5} in extended regular expressions (grep -E).



(In basic regular expressions (plain grep), you really only need to escape the last dollar sign, so $$$$$ would do instead of $$$$$. But in extended (grep -E) and Perl regular expressions they all need to be escaped so better do that anyway.)






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    18















    It seems that $ is a special character for end of line?




    Yep, exactly. And there's an end-of-line on each and every line.



    You'll need to use $$$$$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.



    Or a shorter version regex pattern: ${5} in basic regex or ${5} in extended regular expressions (grep -E).



    (In basic regular expressions (plain grep), you really only need to escape the last dollar sign, so $$$$$ would do instead of $$$$$. But in extended (grep -E) and Perl regular expressions they all need to be escaped so better do that anyway.)






    share|improve this answer




























      18















      It seems that $ is a special character for end of line?




      Yep, exactly. And there's an end-of-line on each and every line.



      You'll need to use $$$$$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.



      Or a shorter version regex pattern: ${5} in basic regex or ${5} in extended regular expressions (grep -E).



      (In basic regular expressions (plain grep), you really only need to escape the last dollar sign, so $$$$$ would do instead of $$$$$. But in extended (grep -E) and Perl regular expressions they all need to be escaped so better do that anyway.)






      share|improve this answer


























        18












        18








        18







        It seems that $ is a special character for end of line?




        Yep, exactly. And there's an end-of-line on each and every line.



        You'll need to use $$$$$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.



        Or a shorter version regex pattern: ${5} in basic regex or ${5} in extended regular expressions (grep -E).



        (In basic regular expressions (plain grep), you really only need to escape the last dollar sign, so $$$$$ would do instead of $$$$$. But in extended (grep -E) and Perl regular expressions they all need to be escaped so better do that anyway.)






        share|improve this answer















        It seems that $ is a special character for end of line?




        Yep, exactly. And there's an end-of-line on each and every line.



        You'll need to use $$$$$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.



        Or a shorter version regex pattern: ${5} in basic regex or ${5} in extended regular expressions (grep -E).



        (In basic regular expressions (plain grep), you really only need to escape the last dollar sign, so $$$$$ would do instead of $$$$$. But in extended (grep -E) and Perl regular expressions they all need to be escaped so better do that anyway.)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 30 '18 at 21:27

























        answered Dec 30 '18 at 17:04









        ilkkachu

        56.3k784156




        56.3k784156















            Popular posts from this blog

            Questions related to Moebius Transform of Characteristic Function of the Primes

            List of scandals in India

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?