[yelp-tools] yelp-build: Drop use of non-portable `expr substr`, #743911
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-tools] yelp-build: Drop use of non-portable `expr substr`, #743911
- Date: Mon, 1 Jun 2015 15:04:41 +0000 (UTC)
commit b44a00287a3e59332a6e57cb39202bb57e1d9dea
Author: Shaun McCance <shaunm gnome org>
Date: Mon Jun 1 11:04:05 2015 -0400
yelp-build: Drop use of non-portable `expr substr`, #743911
tools/yelp-build.in | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/tools/yelp-build.in b/tools/yelp-build.in
index aeb8e56..acd42e8 100755
--- a/tools/yelp-build.in
+++ b/tools/yelp-build.in
@@ -423,14 +423,13 @@ yelp_html_mal2html () {
--stringparam mal.files.copy.js.dir "$yelp_js_dir" \
- "$html_tmp_infile") | sort | uniq | \
while read line; do
- use_internal_datadir=`expr substr "$line" 1 1`
- line=`expr substr "$line" 2 1000`
- line_src=`echo "$line" | cut -d' ' -f1`
- line_src=`echo "$line_src" | urldecode`
+ use_internal_datadir=$(echo "$line" | cut -c1)
+ line=$(echo "$line" | cut -c2-)
+ line_src=$(echo "$line" | cut -d' ' -f1 | urldecode)
if [ "x$use_internal_datadir" = "x+" ]; then
- line_dest="$html_out/$html_internal_datadir"`echo "$line" | cut -d' ' -f2`
+ line_dest="$html_out/$html_internal_datadir"$(echo "$line" | cut -d' ' -f2)
else
- line_dest="$html_out/"`echo "$line" | cut -d' ' -f2`
+ line_dest="$html_out/"$(echo "$line" | cut -d' ' -f2)
fi
if [ ! -f "$line_src" -a "x$html_paths" != "x" ]; then
line_src_rel=${line_src#"$(pwd)/"}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]