cmdchallenge
cmdchallenge copied to clipboard
find tabs in a file not at all complete nor standard
Summary
Commands that work under real Unix do not work here. Expects non-standard args that are not available on Unix. If it is intended to be a Linux command line challenge, please state so.
Steps to reproduce
Go to: https://cmdchallenge.com/#/find_tabs_in_a_file
Run various commands that will print the line count with tabs, and see that it doesn't accept your solution: grep -- $(printf '\t') file-with-tabs.txt | wc -l grep '\t' file-with-tabs.txt | wc -l grep '^V^I' file-with-tabs.txt | wc -l ^^ this one is CTRL-V CTRL-I
Then various ones of the above w/ -c arg to grep instead of | wc -l. None of them worked, but all are valid. You need to add a warning to your tool that it won't accept all valid ways.
Also, in this example, it uses the non-standard -P arg, which is Linux only, and does not work on MacOSX or other Unixes. Please review the Unix specification at: http://pubs.opengroup.org/onlinepubs/9699919799/ to ensure that you are not using other non-standard options.
$'\t'
works
It does kinda say at the very start
Solve the tasks printed below in a single line of bash.
grep -P is not part of bash, and all of the submitted solutions depend upon utilities that are not part of bash.