Skip to content

Instantly share code, notes, and snippets.

@kamermans
Last active April 16, 2024 00:23
Show Gist options
  • Select an option

  • Save kamermans/1f871268f51d21e9930c004493eba76d to your computer and use it in GitHub Desktop.

Select an option

Save kamermans/1f871268f51d21e9930c004493eba76d to your computer and use it in GitHub Desktop.

Revisions

  1. kamermans revised this gist Jan 10, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fix_quotes.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    $!/bin/bash
    #!/bin/bash

    # Replaces annoying "fancy" quotes created by programs like Microsoft Word and everything in MacOS
    # with normal ASCII single-quotes (') or double-quotes (")
  2. kamermans created this gist Oct 19, 2018.
    9 changes: 9 additions & 0 deletions fix_quotes.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    $!/bin/bash

    # Replaces annoying "fancy" quotes created by programs like Microsoft Word and everything in MacOS
    # with normal ASCII single-quotes (') or double-quotes (")
    # This script does NOT replace the GRAVE ACCENT (`) since it is commonly used in Markdown and as a bash command
    # See: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
    SINGLE=$(echo -ne '\u00B4\u2018\u2019')
    DOUBLE=$(echo -ne '\u201C\u201D')
    sed -i "s/[$SINGLE]/'/g; s/[$DOUBLE]/\"/g" $1