X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/07c2c9a3c4cc30da1f60df8c5b1c774466fadf6b..ad1f1455267ff65ac7aeb8fbd3a28c89c16a24f9:/vim/ultisnips/sh.snippets diff --git a/vim/ultisnips/sh.snippets b/vim/ultisnips/sh.snippets index 8393d02..f17a0b5 100644 --- a/vim/ultisnips/sh.snippets +++ b/vim/ultisnips/sh.snippets @@ -12,6 +12,12 @@ snippet ar "${array[@]}" w \${${1:array}[${2:@}]}$0 endsnippet +snippet readline "Read a file line by line" b +while ${1:IFS='' }read -r ${2:line} || [[ -n "$$2" ]]; do + ${0:echo "Text read from file: $$2"} +done < "\$${3:file}" +endsnippet + snippet getopt version="${1:0.1}" @@ -36,7 +42,7 @@ while [[ $# -gt 0 ]]; do echo -e "\n Option does not exist : $opt\n" usage; exit 1 ;; - *) args+=($opt); shift ;; + *) args+=("$opt"); shift ;; esac done endsnippet