Add getline function to zsh

This commit is contained in:
Pavle Portic 2019-06-19 10:08:37 +02:00
parent 286d0e2dd2
commit 4b5f07def5
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# vim: ft=zsh
# Get nth line in a file
if [ -z ${2+x} ]; then
sed -n ${1}p
else
sed -n ${1}p ${2}
fi