Find the answer to your Linux question:
Results 1 to 2 of 2
I'm trying to look at a file and find 6 or more consecutive consonants (everything except a vowel). However I have a hidden $ character at the end of each ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    9

    Ignoring Hidden Characters


    I'm trying to look at a file and find 6 or more consecutive consonants (everything except a vowel). However I have a hidden $ character at the end of each line in the file. For some reason I can't reference to it in any of the pattern searching commands.

    For example: grep '[^aeiouAEIOU$]\{6,\}' file| more

    This command returns words that contain 5 consonants at the end (because it interprets the hidden $ as not a vowel). How can I make it ignore the hidden character? Or more specifically how do I refer to the hidden character in my pattern searches?

    Thank you.

  2. #2
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85
    Quote Originally Posted by whocares357 View Post
    I'm trying to look at a file and find 6 or more consecutive consonants (everything except a vowel). However I have a hidden $ character at the end of each line in the file. For some reason I can't reference to it in any of the pattern searching commands.

    For example: grep '[^aeiouAEIOU$]\{6,\}' file| more

    This command returns words that contain 5 consonants at the end (because it interprets the hidden $ as not a vowel). How can I make it ignore the hidden character? Or more specifically how do I refer to the hidden character in my pattern searches?

    Thank you.
    Not sure what you mean by 'hidden' $ character. Have you tried escaping it?
    Code:
    grep '[^aeiouAEIOU\$$]\{6,\}' file| more
    Edit: Can this trailing character be removed?
    Last edited by barriehie; 11-04-2010 at 03:14 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •