06-25-2009
Shell scripts don't support two-dimensional arrays.
Regards
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I wrote a script in ksh93 (the OS is AIX 5.2, ML7), which failed to run. After some testing i found out why, but the answer is a bit dissatisfying. Look for yourself:
#!/bin/ksh93
# --------- Step Names
typeset achStepName="foo"
typeset achStepName="bar"
typeset achStepName="fubar"... (3 Replies)
Discussion started by: bakunin
3 Replies
2. Shell Programming and Scripting
Hi,
I wish to store $string1 in $string1array a character in each array element.
Then i wish to echo the entire array to the screen so that it reads as the normal string again.
I have been trying with the code below but does not work. Please help...
To put string into array:
... (5 Replies)
Discussion started by: rorey_breaker
5 Replies
3. Programming
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
Snippet 1
This works:
--------------
int *threadids;
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
Discussion started by: kmehta
4 Replies
4. Shell Programming and Scripting
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Discussion started by: zeekblack
1 Replies
5. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies
6. Shell Programming and Scripting
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies
7. Shell Programming and Scripting
Hi everyone
I have one question about using array in perl. let say I have several log file in one folder.. example
test1.log
test2.log
test3.log
and the list goes on..
how to make an array for this file? It suppose to detect log file in the current directory and all the log file will... (3 Replies)
Discussion started by: sayachop
3 Replies
8. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies
9. Shell Programming and Scripting
Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help.
pesudo code
if == ENDSINFIVEINTS ]]; then
do... (4 Replies)
Discussion started by: briandanielz
4 Replies
10. Shell Programming and Scripting
hello,
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
arrayHuge
H = (... (2 Replies)
Discussion started by: f77hack
2 Replies
LEARN ABOUT LINUX
iwgetid
IWGETID(8) Linux Programmer's Manual IWGETID(8)
NAME
iwgetid - Report ESSID, NWID or AP/Cell Address of wireless network
SYNOPSIS
iwgetid [interface] [--raw] [--scheme] [--ap] [--freq]
[--mode] [--protocol] [--channel]
DESCRIPTION
iwgetid is used to find out the NWID, ESSID or AP/Cell Address of the wireless network that is currently used. The information reported is
the same as the one shown by iwconfig, but iwgetid is easier to integrate in various scripts.
By default, iwgetid will print the ESSID of the device, and if the device doesn't have any ESSID it will print its NWID.
The default formatting output is pretty-print.
OPTIONS
--raw This option disables pretty-printing of the information. This option is orthogonal to the other options (except --scheme), so with
the appropriate combination of options you can print the raw ESSID, AP Address or Mode.
This format is ideal when storing the result of iwgetid as a variable in Shell or Perl scripts or to pass the result as an argument
on the command line of iwconfig.
--scheme
This option is similar to the previous one, it disables pretty-printing of the information and removes all characters that are not
alphanumerics (like space, punctuation and control characters).
The resulting output is a valid Pcmcia scheme identifier (that may be used as an argument of the command cardctl scheme). This for-
mat is also ideal when using the result of iwgetid as a selector in Shell or Perl scripts, or as a file name.
--ap Display the MAC address of the Wireless Access Point or the Cell.
--freq Display the current frequency or channel used by the interface.
--channel
Display the current channel used by the interface. The channel is determined using the current frequency and the frequency list pro-
vided by the interface.
--mode Display the current mode of the interface.
--protocol
Display the protocol name of the interface. This allows to identify all the cards that are compatible with each other and accept the
same type of configuration.
This can also be used to check Wireless Extension support on the interface, as this is the only attribute that all drivers support-
ing Wireless Extension are mandated to support.
SEE ALSO
iwconfig(8), ifconfig(8), iwspy(8), iwpriv(8).
wireless-tools 02 December 2003 IWGETID(8)