1if [ ! "$_STRINGS_SUBR" ]; then _STRINGS_SUBR=1
2#
3# Copyright (c) 2006-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/strings.subr 247280 2013-02-25 19:55:32Z dteske $
28
29# f_substr "$string" $start [ $length ]
30#
31# Simple wrapper to awk(1)'s `substr' function.
32#
33f_substr()
34{
35 local string="$1" start="${2:-0}" len="${3:-0}"
36 echo "$string" | awk "{ print substr(\$0, $start, $len) }"
--- 125 unchanged lines hidden (view full) ---
162{
163 if [ $# -gt 0 ]; then
164 echo "$1" | awk "$f_uridecode_awk"
165 else
166 awk "$f_uridecode_awk"
167 fi
168}
169
170f_dprintf "%s: Successfully loaded." strings.subr
171
172fi # ! $_STRINGS_SUBR
2#
3# Copyright (c) 2006-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/strings.subr 247280 2013-02-25 19:55:32Z dteske $
28
29# f_substr "$string" $start [ $length ]
30#
31# Simple wrapper to awk(1)'s `substr' function.
32#
33f_substr()
34{
35 local string="$1" start="${2:-0}" len="${3:-0}"
36 echo "$string" | awk "{ print substr(\$0, $start, $len) }"
--- 125 unchanged lines hidden (view full) ---
162{
163 if [ $# -gt 0 ]; then
164 echo "$1" | awk "$f_uridecode_awk"
165 else
166 awk "$f_uridecode_awk"
167 fi
168}
169
170f_dprintf "%s: Successfully loaded." strings.subr
171
172fi # ! $_STRINGS_SUBR