public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Ondrej Oprala <ondrej.oprala@gmail.com>
To: libabigail@sourceware.org
Subject: [PATCH] Clean-up scripts
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <1785d2f2-8fce-f2d2-1453-16c7257e79bf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

Hi, attached are a few robustness safety nets that have appeared in 
shellcheck's warnings.

Cheers,

   Ondrej


[-- Attachment #2: 0001-Clean-up-scripts.patch --]
[-- Type: text/x-patch, Size: 2430 bytes --]

From 077df47f791837a114f49178f37f0453683b92b5 Mon Sep 17 00:00:00 2001
From: Ondrej Oprala <ondrej.oprala@gmail.com>
Date: Tue, 11 Apr 2017 16:57:07 +0200
Subject: [PATCH 1/3] Clean up scripts/*

	* scripts/dot_to_png.sh: Clean up the script according to
	shellcheck warnings and remarks.
	* scripts/dot_to_svg.sh: Likewise.
	* scripts/svg_to_plain_svg.sh: Likewise.
	* scripts/svg_to_png_and_pdf.sh: Likewise.

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
---
 scripts/dot_to_png.sh         | 10 +++++-----
 scripts/dot_to_svg.sh         | 10 +++++-----
 scripts/svg_to_plain_svg.sh   |  6 +++---
 scripts/svg_to_png_and_pdf.sh |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/scripts/dot_to_png.sh b/scripts/dot_to_png.sh
index 24a7dc7..0929bdd 100755
--- a/scripts/dot_to_png.sh
+++ b/scripts/dot_to_png.sh
@@ -1,9 +1,9 @@
-#!/bin/bash 
+#!/bin/bash
 
 for i in *.gv
 do
-  echo $i
-  outputpng=`echo $i | sed -e 's/gv/png/'`; 
-  echo $outputpng
-  dot -v -Tpng:cairo -o $outputpng $i;
+  echo "$i"
+  outputpng=${i//gv/png}
+  echo "$outputpng"
+  dot -v -Tpng:cairo -o "$outputpng" "$i"
 done
diff --git a/scripts/dot_to_svg.sh b/scripts/dot_to_svg.sh
index 6b211f7..72d298e 100755
--- a/scripts/dot_to_svg.sh
+++ b/scripts/dot_to_svg.sh
@@ -1,9 +1,9 @@
-#!/bin/bash 
+#!/bin/bash
 
 for i in *.gv
 do
-  echo $i
-  outputsvg=`echo $i | sed -e 's/gv/svg/'`; 
-  echo $outputsvg
-  dot -v -Tsvg:cairo -o $outputsvg $i;
+  echo "$i"
+  outputsvg=${i//gv/svg}
+  echo "$outputsvg"
+  dot -v -Tsvg:cairo -o "$outputsvg" "$i"
 done
diff --git a/scripts/svg_to_plain_svg.sh b/scripts/svg_to_plain_svg.sh
index 7d877f9..5ebb7a4 100755
--- a/scripts/svg_to_plain_svg.sh
+++ b/scripts/svg_to_plain_svg.sh
@@ -1,5 +1,5 @@
-#!/bin/bash 
+#!/bin/bash
 
-for i in *.svg; 
-  do inkscape $i --export-plain-svg=`echo $i | sed -e 's/svg$/plain.svg/'`; 
+for i in *.svg;
+  do inkscape "$i" --export-plain-svg="${i//svg/plain.svg}"
 done
diff --git a/scripts/svg_to_png_and_pdf.sh b/scripts/svg_to_png_and_pdf.sh
index 451747a..b55515b 100755
--- a/scripts/svg_to_png_and_pdf.sh
+++ b/scripts/svg_to_png_and_pdf.sh
@@ -1,5 +1,5 @@
-#!/bin/bash 
+#!/bin/bash
 
-for i in *.svg; 
-  do inkscape $i --export-png=`echo $i | sed -e 's/svg$/png/'` --export-pdf=`echo $i | sed -e 's/svg$/pdf/'`; 
+for i in *.svg;
+  do inkscape "$i" --export-png="${i//svg/png}" --export-pdf="${i//svg/pdf}"
 done
-- 
2.7.4


             reply	other threads:[~2017-04-12 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 Ondrej Oprala [this message]
2017-01-01  0:00 ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1785d2f2-8fce-f2d2-1453-16c7257e79bf@gmail.com \
    --to=ondrej.oprala@gmail.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).