dotfiles/.config/fish/functions/take_skip.fish

14 lines
332 B
Fish
Raw Normal View History

2022-08-24 11:09:22 +00:00
# Function for ignoring the first 'n' lines
# ex: seq 10 | skip 5
# results: prints everything but the first 5 lines
function skip --argument n
tail +(math 1 + $n)
end
# Function for taking the first 'n' lines
# ex: seq 10 | take 5
# results: prints only the first 5 lines
function take --argument number
head -$number
end