GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Unix Array Variables
Operating System - HP-UX
1845956
Members
2497
Online
110250
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2006 02:00 AM
04-03-2006 02:00 AM
Unix Array Variables
Hi,
I want a simple Unix shell programes to understand unix array variables of character strings and numbers.
(define, setting value, manipulation, and printing).
Thanks
Ezhil
I want a simple Unix shell programes to understand unix array variables of character strings and numbers.
(define, setting value, manipulation, and printing).
Thanks
Ezhil
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2006 02:29 AM
04-03-2006 02:29 AM
Re: Unix Array Variables
Hi Ezhil:
Perhaps this helps:
#!/usr/bin/sh
echo "Enter a series of space-delimited fields to populate ARY"
read LINE
set -A ARY ${LINE}
echo "${#ARY[*]} elements exist"
echo "element_0 = ${ARY[0]}"
echo "element_1 = ${ARY[1]}"
exit 0
The 'set' declares an array named ARY and populates it with the contents of LINE.
You have knowledge of how many elements exist as shown and how to reference individual elements.
See the manpages for 'sh-posix' for more information, particularly the 'set' statement.
Regards!
...JRF...
Perhaps this helps:
#!/usr/bin/sh
echo "Enter a series of space-delimited fields to populate ARY"
read LINE
set -A ARY ${LINE}
echo "${#ARY[*]} elements exist"
echo "element_0 = ${ARY[0]}"
echo "element_1 = ${ARY[1]}"
exit 0
The 'set' declares an array named ARY and populates it with the contents of LINE.
You have knowledge of how many elements exist as shown and how to reference individual elements.
See the manpages for 'sh-posix' for more information, particularly the 'set' statement.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2006 02:40 AM
04-03-2006 02:40 AM
Re: Unix Array Variables
Hi,
Check these links for more information
http://www.samspublishing.com/articles/article.asp?p=29246&rl=1
http://www.awprofessional.com/articles/article.asp?p=99035&seqNum=4&rl=1
-Arun
Check these links for more information
http://www.samspublishing.com/articles/article.asp?p=29246&rl=1
http://www.awprofessional.com/articles/article.asp?p=99035&seqNum=4&rl=1
-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP