[Assorted-commits] SF.net SVN: assorted: [525] sandbox/trunk/src/bash/empty-array.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-29 03:35:21
|
Revision: 525 http://assorted.svn.sourceforge.net/assorted/?rev=525&view=rev Author: yangzhang Date: 2008-02-28 19:35:26 -0800 (Thu, 28 Feb 2008) Log Message: ----------- added empty-array test Added Paths: ----------- sandbox/trunk/src/bash/empty-array.bash Added: sandbox/trunk/src/bash/empty-array.bash =================================================================== --- sandbox/trunk/src/bash/empty-array.bash (rev 0) +++ sandbox/trunk/src/bash/empty-array.bash 2008-02-29 03:35:26 UTC (rev 525) @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -o nounset -o errexit + +# This works. +arr=1 +echo "${arr[@]}" + +# This fails; apparently empty arrays expanded this way are unset variables. +arr=() +echo "${arr[@]}" Property changes on: sandbox/trunk/src/bash/empty-array.bash ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |