Skip to content

Instantly share code, notes, and snippets.

@demonbane
Last active March 10, 2018 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demonbane/cb352cbc8e01f16ced94bd9531f775b9 to your computer and use it in GitHub Desktop.
Save demonbane/cb352cbc8e01f16ced94bd9531f775b9 to your computer and use it in GitHub Desktop.
~# foo='one
> two
> three'
~# hd <<< $foo
00000000 6f 6e 65 20 74 77 6f 20 74 68 72 65 65 0a |one two three.|
0000000e
~# hd <<< "$foo"
00000000 6f 6e 65 0a 74 77 6f 0a 74 68 72 65 65 0a |one.two.three.|
0000000e
~# bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~# echo $BASH_VERSION
4.3.48(1)-release
~# declare -p BASH_VERSINFO
declare -ar BASH_VERSINFO='([0]="4" [1]="3" [2]="48" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")'
~# foo='one
> two
> three'
~# hd <<< $foo
00000000 6f 6e 65 0a 74 77 6f 0a 74 68 72 65 65 0a |one.two.three.|
0000000e
~# hd <<< "$foo"
00000000 6f 6e 65 0a 74 77 6f 0a 74 68 72 65 65 0a |one.two.three.|
0000000e
~# bash --version
GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~# echo $BASH_VERSION
4.4.12(1)-release
~# declare -p BASH_VERSINFO
declare -ar BASH_VERSINFO=([0]="4" [1]="4" [2]="12" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment