Quote:
Quote:
|
Quote:
Code:
#!/bin/bash |
Quote:
|
Quote:
|
Quote:
|
Quote:
@OP: Please provide a sample output file of what you expect it to look like before we keep guessing. |
If you want to not print lines that have a forbidden character, with grep:
Code:
grep -v '[^a-zA-Z0-9-]' testfile For the [a-zA-Z0-9] set there is [[:alnum:]], can be augmented with extra characters and of course with the ^ negation: Code:
grep -v '[^[:alnum:]-]' testfile |
Quote:
|
Quote:
|
Quote:
Code:
grep -v '[^[:alnum:].-]' testfile Code:
grep -v '[^.[:alnum:]-]' testfile Quote:
|
Quote:
|
Quote:
|
Hello,
That worked perfectly fine; however what I am trying to match here is and not sure if this can be achieved in the same line. Since the above pattern is catching single dot as liternal and hyphen. Being a domain name those will be surrounded by alnum hence trying hard for validation to match . and - only if surrounded by \wfollowed by those two literals. May be I am missing something? Quote:
|
Quote:
You have been presented with a solution that works for the sample file you provided. Now you are telling us that the sample file is not representing the actual input data, thus the solution is inappropriate. It is pointless to provide you with a solution if you keep changing the requirement. |
wrong post.. oops
|
All times are GMT -5. The time now is 11:10 PM. |