bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[50 character or so descriptive subject here (for reference)]


From: Mario V Nigrovic
Subject: [50 character or so descriptive subject here (for reference)]
Date: Thu, 17 Jul 2003 18:17:24 -0700 (MST)

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.8
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' 
-DCONF_OSTYPE='solaris2.8' -DCONF_MACHTYPE='sparc-sun-solaris2.8' 
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I/media/gnu/bash-2.05 
-I/media/gnu/bash-2.05/include -I/media/gnu/bash-2.05/lib 
-I/tools/GNU/003/SunOS_5.8/include -g -O2
uname output: SunOS jaguar 5.8 Generic_108528-22 sun4u sparc SUNW,Ultra-60
Machine Type: sparc-sun-solaris2.8

Bash Version: 2.05
Patch Level: 0
Release Status: release

Description:
        Is there some syntax to return just the index portions of
        arrays?

        I can assign arrays via

        list=([5]=home [6]=work [25]=other)

        and get all the information out with

        declare -p list

        but there are times I'd like to iterate over an array by using
        its indices rather than just data:

        patchrev=([123456]=08 [444323]=01)

        There may already be some syntax to just return 123456 and 444323,
        but if not then maybe ${?patchrev[*]}?

        So then I could

        for patch in ${?patchrev[*]}; do
          echo "Version of patch $patch is ${patchrev[$patch]}."
        done

        Thanks,
             Mario




reply via email to

[Prev in Thread] Current Thread [Next in Thread]