4 ms·
When sorting the file first I get no output anymore: sort ~/.zshrc -o /tmp/.zshrc look "#" /tmp/.zshrc Sorry for the noise but I am confused... :|
by hanez 11y ago
When sorting the file first I get no output anymore:
sort ~/.zshrc -o /tmp/.zshrc
look "#" /tmp/.zshrc
Sorry for the noise but I am confused... :|
- deleted 11y ago[deleted]
- emmelaich 11y agosort(1) might not use the same ordering as look(1) Try setting LC_COLLATE=C and export it and retry.
- hanez 11y agoUh, wow! That was it! Thanks for this answer...
- andreasvc 11y agoIt doesn't make sense to sort a configuration file, order and context matters. Easier to just use grep '^#' (or even better, ag).
- hanez 11y agoYes, I am aware of that but I wanted to understand the usage of 'look' at this point. It was a fault to try stuff using the .zshrc file at first because I ran into misunderstanding everything. It was just the first file that came in mind to me. Since sorting a source file and then "looking" for comments makes no sense in any way, grep seems to be really the better choice.