Testing Fgrep Gives Same Results As Grepgrep command not returning all resultsgrep keeps printing the same...

SET NOCOUNT Error in handling SQL call after upgrade

If I delete my router's history can my ISP still provide it to my parents?

The use of the spellings -zz- vs. -z-

LuaTex and em dashes

Making him into a bully (how to show mild violence)

How old is the day of 24 equal hours?

Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?

Early credit roll before the end of the film

Cookies - Should the toggles be on?

Can you tell from a blurry photo if focus was too close or too far?

Graph with overlapping labels

When can a QA tester start his job?

kill -0 <PID> は何をするのでしょうか?

What is the wife of a henpecked husband called?

How should I handle players who ignore the session zero agreement?

Why are the books in the Game of Thrones citadel library shelved spine inwards?

What's a good word to describe a public place that looks like it wouldn't be rough?

Can a Pact of the Blade warlock use the correct existing pact magic weapon so it functions as a "Returning" weapon?

Can a hotel cancel a confirmed reservation?

Intern applicant asking for compensation equivalent to that of permanent employee

Looking for access to original paper for Category O

Why exactly do action photographers need high fps burst cameras?

How did Ancient Greek 'πυρ' become English 'fire?'

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?



Testing Fgrep Gives Same Results As Grep


grep command not returning all resultsgrep keeps printing the same stringHow to filter grep results?problem with grepGrep : Filtering QuestionI cannot get grep to print resultsWhy isn't simple use of grep not coming up with any results?How to avoid having newlines with grep -o for multiple match at the same line?strange results with grep regular expression when used with pipe“ls | grep zip” vs. “grep zip $(ls)”













0















I'm trying to learn how fgrep differs from grep. However in my test results, there is no difference. Apparently fgrep matches on strings and ignores regex. So I put this to the test and there was absolutely nothing that a basic fgrep can do, that grep can't. So I can't move on, I need to understand why I have the results below, and what the difference between fgrep is, since I categorically cannot see any difference in any test result.



$ cat testfile
subscribe|unsubscribe
@lp1n3

$ grep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe
$ fgrep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe

$ grep '@lp1n3' testfile
@lp1n3
$ fgrep '@lp1n3' testfile
@lp1n3








share























  • | isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

    – steeldriver
    55 secs ago
















0















I'm trying to learn how fgrep differs from grep. However in my test results, there is no difference. Apparently fgrep matches on strings and ignores regex. So I put this to the test and there was absolutely nothing that a basic fgrep can do, that grep can't. So I can't move on, I need to understand why I have the results below, and what the difference between fgrep is, since I categorically cannot see any difference in any test result.



$ cat testfile
subscribe|unsubscribe
@lp1n3

$ grep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe
$ fgrep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe

$ grep '@lp1n3' testfile
@lp1n3
$ fgrep '@lp1n3' testfile
@lp1n3








share























  • | isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

    – steeldriver
    55 secs ago














0












0








0








I'm trying to learn how fgrep differs from grep. However in my test results, there is no difference. Apparently fgrep matches on strings and ignores regex. So I put this to the test and there was absolutely nothing that a basic fgrep can do, that grep can't. So I can't move on, I need to understand why I have the results below, and what the difference between fgrep is, since I categorically cannot see any difference in any test result.



$ cat testfile
subscribe|unsubscribe
@lp1n3

$ grep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe
$ fgrep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe

$ grep '@lp1n3' testfile
@lp1n3
$ fgrep '@lp1n3' testfile
@lp1n3








share














I'm trying to learn how fgrep differs from grep. However in my test results, there is no difference. Apparently fgrep matches on strings and ignores regex. So I put this to the test and there was absolutely nothing that a basic fgrep can do, that grep can't. So I can't move on, I need to understand why I have the results below, and what the difference between fgrep is, since I categorically cannot see any difference in any test result.



$ cat testfile
subscribe|unsubscribe
@lp1n3

$ grep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe
$ fgrep 'subscribe|unsubscribe' testfile
subscribe|unsubscribe

$ grep '@lp1n3' testfile
@lp1n3
$ fgrep '@lp1n3' testfile
@lp1n3






grep





share












share










share



share










asked 5 mins ago









john smithjohn smith

1,05642040




1,05642040













  • | isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

    – steeldriver
    55 secs ago



















  • | isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

    – steeldriver
    55 secs ago

















| isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

– steeldriver
55 secs ago





| isn't a regular expression special character in Grep basic regular expressions (BRE) so it is treated as literal. AFAIK @ isn't a regex character in any variety.

– steeldriver
55 secs ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f1121976%2ftesting-fgrep-gives-same-results-as-grep%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 Ask Ubuntu!


  • 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%2faskubuntu.com%2fquestions%2f1121976%2ftesting-fgrep-gives-same-results-as-grep%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

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...