Hacker News new | ask | show | jobs
by KMnO4 2151 days ago
Very cool! I was a bit confused with the marking criteria. For example, my solution for "list all files on one line" appears to work correctly but is said to be incorrect.

    shopt -s dotglob; for i in *; do echo -n "$i "; done
EDIT: I now see that the correct answer is simply "`echo *`". Despite having a dotfile in the directory, it should not be shown.
1 comments

Ah, that is a bug the dotfile should not be there. Thanks!
So the dotfile is resolved but the solution:

  shopt -s dotglob; for i in *; do echo -n "$i "; done
still isn't valid unfortunately because of the extra space at the end, maybe it should be more forgiving about that.