-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find_tabs_in_a_file: not accepting solution as valid #90
Comments
I don't want to reveal the answer but you're missing an option there. |
No. See:
|
Different versions of grep support different types of escapes. tom@computer:~$ echo '\t'
\t
tom@computer:~$ echo $'\t'
For more info about bash escaping see http://tldp.org/LDP/abs/html/escapingsection.html Grep supports different regex engines with slightly different behaviors, which is an alternative way to get something like |
sooo... how does this change the fact that a working solution (verified by gnu grep 2.20 and bsd grep 2.5) does not work in the challenge? |
@benko Different versions of bash and grep don't tell the whole story. Warning: Spoiler alert tom@computer:~$ grep -V
grep (GNU grep) 2.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
tom@computer:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
tom@computer:~$ grep '\t' file-with-tabs.txt
tom@computer:~$ grep $'\t' file-with-tabs.txt
a
c
e
tom@computer:~$ grep '\x09' file-with-tabs.txt
tom@computer:~$ grep $'\x09' file-with-tabs.txt
a
c
e |
@tomleo, so what we can conclude is that either the instructions are incomplete or the solution list is. |
@benko It's possible the solution list is incomplete, but |
then be clear about it. unix is about being portable as much as it is about knowing the specifics of the environment you're currently working in. precisely for the reason of being portable. |
Summary
https://cmdchallenge.com/#/find_tabs_in_a_file
The problem is (also) solvable using "grep -c '\t' file-with-tabs.txt", however, it is not accepted.
Steps to reproduce
The text was updated successfully, but these errors were encountered: