Issue
sysadmin@localhost:~/Documents$ grep '[.]' profile.txt Hello my name is Joe**.** I am 37 years old**.** My favorite food is avocados**.** I have 2 dogs**.**
sysadmin@localhost:~/Documents$ grep [.] profile.txt Hello my name is Joe**.** I am 37 years old**.** My favorite food is avocados**.** I have 2 dogs**.**
They both outputed the same answer but there's something hidden that i'm missing?
Solution
No, there is no difference. In this StackOverflow post with a similar question, the accepted answer shows how you can use echo
to test out in what way your command is being processed before being executed.
Try out the following:
someone@somewhere:~$ echo grep [.] profile.txt
grep [.] test.txt
someone@somewhere:~$ echo grep '[.]' profile.txt
grep [.] test.txt
You see, the commands that are executed are the same exact commands :)
Answered By - Koedlt Answer Checked By - Mary Flores (WPSolving Volunteer)