local enable_static_libraries="yes"
local enable_includes="yes"
- if [[ $# -gt 0 ]] ; then
- t=$#
+ if [[ ${#} -gt 0 ]] ; then
+ t=${#}
while [[ ${i} -lt ${t} ]] ; do
let i=${i}+1
fi
else
if [[ ${grab_next} == "path_build" ]] ; then
- path_build=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ path_build=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "prefix" ]] ; then
- destination_prefix=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_prefix=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "bindir" ]] ; then
- destination_programs=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_programs=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "docdir" ]] ; then
- destination_documentation=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_documentation=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "etcdir" ]] ; then
- destination_settings=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_settings=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "includedir" ]] ; then
- destination_includes=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_includes=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "libdir" ]] ; then
- destination_libraries=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_libraries=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "work" ]] ; then
- work=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ work=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "destination_libraries_static" ]] ; then
- destination_libraries_static=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_libraries_static=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "destination_libraries_shared" ]] ; then
- destination_libraries_shared=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_libraries_shared=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "destination_programs_static" ]] ; then
- destination_programs_static=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_programs_static=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
elif [[ ${grab_next} == "destination_programs_shared" ]] ; then
- destination_programs_shared=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|')
+ destination_programs_shared=$(sed -e 's|^//*|/|' -e 's|/*$|/|' <<< ${p})
fi
grab_next=
fi
if [[ ${destination_prefix} != "" ]] ; then
- if [[ $(echo ${destination_documentation} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_documentation}) == "" ]] ; then
destination_documentation="${destination_prefix}${destination_documentation}"
fi
- if [[ $(echo ${destination_programs} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_programs}) == "" ]] ; then
destination_programs="${destination_prefix}${destination_programs}"
fi
- if [[ $(echo ${destination_includes} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_includes}) == "" ]] ; then
destination_includes="${destination_prefix}${destination_includes}"
fi
- if [[ $(echo ${destination_libraries} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_libraries}) == "" ]] ; then
destination_libraries="${destination_prefix}${destination_libraries}"
fi
- if [[ $(echo ${destination_settings} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_settings}) == "" ]] ; then
destination_settings="${destination_prefix}${destination_settings}"
fi
fi
if [[ ${destination_libraries_static} != "" ]] ; then
- if [[ $(echo ${destination_libraries_static} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_libraries_static}) == "" ]] ; then
destination_libraries_static=${destination_libraries}${destination_libraries_static}
fi
else
fi
if [[ ${destination_libraries_shared} != "" ]] ; then
- if [[ $(echo ${destination_libraries_shared} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_libraries_shared}) == "" ]] ; then
destination_libraries_shared=${destination_libraries}${destination_libraries_shared}
fi
else
fi
if [[ ${destination_programs_static} != "" ]] ; then
- if [[ $(echo ${destination_programs_static} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_programs_static}) == "" ]] ; then
destination_programs_static=${destination_programs}${destination_programs_static}
fi
else
fi
if [[ ${destination_programs_shared} != "" ]] ; then
- if [[ $(echo ${destination_programs_shared} | grep -o '^/') == "" ]] ; then
+ if [[ $(grep -sho '^/' <<< ${destination_programs_shared}) == "" ]] ; then
destination_programs_shared=${destination_programs}${destination_programs_shared}
fi
else
if [[ ${failure} -eq 0 && -d ${path_build}${path_includes} && ${enable_includes} == "yes" ]] ; then
for i in ${path_build}${path_includes}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_includes}||")
+ file=$(sed -e "s|^${path_build}${path_includes}||" <<< ${i})
break
done
if [[ -d ${path_build}${path_libraries}${path_static} && ${enable_static_libraries} == "yes" ]] ; then
for i in ${path_build}${path_libraries}${path_static}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_libraries}${path_static}||")
+ file=$(sed -e "s|^${path_build}${path_libraries}${path_static}||" <<< ${i})
break
done
if [[ ${failure} -eq 0 && -d ${path_build}${path_libraries}${path_shared} && ${enable_shared_libraries} == "yes" ]] ; then
for i in ${path_build}${path_libraries}${path_shared}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_libraries}${path_shared}||")
+ file=$(sed -e "s|^${path_build}${path_libraries}${path_shared}||" <<< ${i})
break
done
if [[ -d ${path_build}${path_programs}${path_static} && ${enable_static_programs} == "yes" ]] ; then
for i in ${path_build}${path_programs}${path_static}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_programs}${path_static}||")
+ file=$(sed -e "s|^${path_build}${path_programs}${path_static}||" <<< ${i})
break
done
if [[ ${failure} -eq 0 && -d ${path_build}${path_programs}${path_shared} && ${enable_shared_programs} == "yes" ]] ; then
for i in ${path_build}${path_programs}${path_shared}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_programs}${path_shared}||")
+ file=$(sed -e "s|^${path_build}${path_programs}${path_shared}||" <<< ${i})
break
done
if [[ ${failure} -eq 0 && -d ${path_build}${path_settings} && ${enable_settings} == "yes" ]] ; then
for i in ${path_build}${path_settings}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_settings}||")
+ file=$(sed -e "s|^${path_build}${path_settings}||" <<< ${i})
break
done
if [[ ${failure} -eq 0 && -d ${path_build}${path_documentation} && ${enable_documentation} == "yes" ]] ; then
for i in ${path_build}${path_documentation}* ; do
- file=$(echo ${i} | sed -e "s|^${path_build}${path_documentation}||")
+ file=$(sed -e "s|^${path_build}${path_documentation}||" <<< ${i})
break
done