Skip to content

Instantly share code, notes, and snippets.

@cxreg
Created March 16, 2013 01:04
Show Gist options
  • Save cxreg/5174403 to your computer and use it in GitHub Desktop.
Save cxreg/5174403 to your computer and use it in GitHub Desktop.
bash ... wat
count@narbuckle:~$ bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
count@narbuckle:~$ foo=(1 2 3 4 5); unset foo[4]; echo ${foo[@]}; unset foo[3]; echo ${foo[@]}; unset foo[2]; echo ${foo[@]};
1 2 3 4
1 2 3
1 2
dolszewski@blackheat:~$ bash --version
GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 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.
dolszewski@blackheat:~$ foo=(1 2 3 4 5); unset foo[4]; echo ${foo[@]}; unset foo[3]; echo ${foo[@]}; unset foo[2]; echo ${foo[@]};
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
count@bumba:~$ bash --version
GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 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.
count@bumba:~$ foo=(1 2 3 4 5); unset foo[4]; echo ${foo[@]}; unset foo[3]; echo ${foo[@]}; unset foo[2]; echo ${foo[@]};
1 2 3 4
1 2 3
1 2 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment