cmdchallenge icon indicating copy to clipboard operation
cmdchallenge copied to clipboard

find tabs in a file not at all complete nor standard

Open jmgnc opened this issue 7 years ago • 3 comments

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.

jmgnc avatar Feb 02 '17 02:02 jmgnc

$'\t' works

avioli avatar Feb 02 '17 02:02 avioli

It does kinda say at the very start

Solve the tasks printed below in a single line of bash.

0ki avatar Feb 03 '17 04:02 0ki

grep -P is not part of bash, and all of the submitted solutions depend upon utilities that are not part of bash.

jmgnc avatar Nov 01 '18 23:11 jmgnc