Replies: 3 comments
-
|
I agree, it would be cool if we could do Python-style negative-number ranges like this: bat file.txt -r -10:which would mean: "10 lines from the end until the end". It would be great if you could open a feature request for this. Until then, your solution seems fine. Another option would be to use tail -n10 file.txt | bat -l<language>Or you could use bat -fp file.txt | tail -n10 |
Beta Was this translation helpful? Give feedback.
-
|
done here: #2251 |
Beta Was this translation helpful? Give feedback.
-
|
SO there's no way for bat to know what the last 10 lines of a file are? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
so I can use ranges to print the lines, but how would I for example print the last 10 lines of a file?
I can do this:
bat file.txt-r $(echo $(wc file.txt | awk '{print $1}') - 10 | bc):but is there no better way?
Beta Was this translation helpful? Give feedback.
All reactions