On Jun 23, 2009, at 7:36 PM, Charles Curley wrote:
> I think this used to work. Ideas?
Works for me... something like;
if [ $# -eq 1 ]; then
array=( $(find /bin -name *at*) )
echo "Elements in array: ${#array[*]}"
for index in ${!array[*]}
do
printf "%4d: %s\n" $index ${array[$index]}
done
else
echo "Nothing to see here"
fi
OUTPUT:
Mac OS X:
--------------
Elements in array: 3
0: /bin/cat
1: /bin/date
2: /bin/wait4path
Ubuntu 9.04:
------------------
Elements in array: 7
0: /bin/zcat
1: /bin/netcat
2: /bin/date
3: /bin/cat
4: /bin/netstat
5: /bin/bzcat
6: /bin/ld_static
> ccur...@dragon:~$ bash --version
> GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
> Copyright (C) 2007 Free Software Foundation, Inc.
> ccur...@dragon:~$
On both Mac OS X
ares: chad$ bash -version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Copyright (C) 2005 Free Software Foundation, Inc.
and Ubuntu 9.04
c...@mars:~$ bash -version
GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
Could you perhaps add more code and maybe I could help?
---
Chad R Mayfield
[email protected]
GPG Key: 0C9A026F
http://www.planetmayfield.com/
http://www.chadmayfield.com/
http://www.linkedin.com/in/chadmayfield
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/