Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Last active January 18, 2017 17:22
Show Gist options
  • Save neilhwatson/28b8acddcfaf2e2becace34be6686bc5 to your computer and use it in GitHub Desktop.
Save neilhwatson/28b8acddcfaf2e2becace34be6686bc5 to your computer and use it in GitHub Desktop.

Revisions

  1. neilhwatson revised this gist Jan 18, 2017. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions v.sh
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,15 @@
    cat ~/src/neil/test/v.sh
    #!/bin/sh

    $variables='Do not show'
    variables='Do not show'

    x='
    Do not expand \\ type escapes and
    all $variables
    '

    printf "$x"
    echo "$x"

    $ ~/src/neil/test/v.sh
    /home/neil/src/neil/test/v.sh: 3: /home/neil/src/neil/test/v.sh: =Do not show: not found

    Do not expand \ type escapes and
    all $variables
  2. neilhwatson revised this gist Jan 18, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions v.sh
    Original file line number Diff line number Diff line change
    @@ -10,10 +10,9 @@ all $variables

    printf "$x"

    neil@luna:~/src/nextpathway/elt/ambari-config$ ~/src/neil/test/v.sh
    $ ~/src/neil/test/v.sh
    /home/neil/src/neil/test/v.sh: 3: /home/neil/src/neil/test/v.sh: =Do not show: not found

    Do not expand \ type escapes and
    all $variables

    ## Wrong. Expected to see \\ not \
  3. neilhwatson revised this gist Jan 18, 2017. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions v.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/sh -x
    cat ~/src/neil/test/v.sh
    #!/bin/sh

    $variables='Do not show'

    @@ -7,4 +8,12 @@ Do not expand \\ type escapes and
    all $variables
    '

    echo "$x"
    printf "$x"

    neil@luna:~/src/nextpathway/elt/ambari-config$ ~/src/neil/test/v.sh
    /home/neil/src/neil/test/v.sh: 3: /home/neil/src/neil/test/v.sh: =Do not show: not found

    Do not expand \ type escapes and
    all $variables

    ## Wrong. Expected to see \\ not \
  4. neilhwatson created this gist Jan 18, 2017.
    10 changes: 10 additions & 0 deletions v.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/sh -x

    $variables='Do not show'

    x='
    Do not expand \\ type escapes and
    all $variables
    '

    echo "$x"