|
@ -2103,9 +2103,20 @@ _head_n() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_tail_n() { |
|
|
_tail_n() { |
|
|
if ! tail -n "$1" 2>/dev/null; then |
|
|
|
|
|
|
|
|
if _is_solaris; then |
|
|
#fix for solaris |
|
|
#fix for solaris |
|
|
tail -"$1" |
|
|
tail -"$1" |
|
|
|
|
|
else |
|
|
|
|
|
tail -n "$1" |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_tail_c() { |
|
|
|
|
|
if _is_solaris; then |
|
|
|
|
|
#fix for solaris |
|
|
|
|
|
tail -"$1"c |
|
|
|
|
|
else |
|
|
|
|
|
tail -c "$1" |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -2280,7 +2291,7 @@ _setopt() { |
|
|
if [ ! -f "$__conf" ]; then |
|
|
if [ ! -f "$__conf" ]; then |
|
|
touch "$__conf" |
|
|
touch "$__conf" |
|
|
fi |
|
|
fi |
|
|
if [ -n "$(tail -c1 <"$__conf")" ]; then |
|
|
|
|
|
|
|
|
if [ -n "$(_tail_c 1 <"$__conf")" ]; then |
|
|
echo >>"$__conf" |
|
|
echo >>"$__conf" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|