Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Perl: How to check whether my array contains element x Post 302757203 by javaholics on Thursday 17th of January 2013 07:42:25 AM
Old 01-17-2013
Perl: How to check whether my array contains element x

Hi All,
I am new to perl I am stuck in simple problem I need your help
I want to define a subroutine.

sub check_if_entity_exists(@array_to_be_checked,$entityName)

I have array as

If i send http-listener-3 my subroutine should return me true and false if the array doesn't contain the element
Test Your Knowledge in Computers #600
Difficulty: Medium
Functions in C do not need be declared before they can be used.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl delete an element from array

Probably I am not seeing it or I am not using the "delete" correctly I had the following codes but it does not work for me #!/bin/perl -w ... @sysFile1 = (a_b, a_c, a_d); @sysFile2 = (a_c, a_e, b_f); foreach $line1 (@sysFile1){ trim(\$line1); (my $tmp1, my $tmp2) = split/_/,... (6 Replies)
Discussion started by: ahtat99
6 Replies

2. Shell Programming and Scripting

Remove an element from an array in PERL

Hello guys, I have the following question. Consider the following code in PERL for($xeAnumber=0; $xeAnumber<@xeAnumber; $xeAnumber++) { if(@xeAnumber==@final_file) { @final_file=@xeTimeStamp; }... (3 Replies)
Discussion started by: chriss_58
3 Replies

3. Shell Programming and Scripting

How to check index of a array element in shell script?

Example - Script to find the index of a month from array MONTHS="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" set -A MON $MONTHS A="Sun May 23 09:34:30 GMT 2010" getMonth=`echo $A|cut -c5-7` ##getMonth=May Arrayindex_in_MONTHS_array= ???? # { 0,1,2,3,4 } - at fifth place ... (7 Replies)
Discussion started by: KuldeepSinghTCS
7 Replies

4. Shell Programming and Scripting

Help! Yet another check element in array Question

Greetings, DISCLAIMER: My shell scripting is rusty so my question may be borderline stupid. You've been warned. I need to create a script that a) lists the content of zip files in a directory and b) sends out an `exception` report. My ZIP files contain a control file (for load check). I want... (2 Replies)
Discussion started by: alan
2 Replies

5. Shell Programming and Scripting

remove an element from array

I need to remove an element from the below array variable TABLENAME. #!/bin/ksh set -A TABLENAME "mirf roxar keke mirs" echo "the array is ${TABLENAME}" If i need to remove say keke and have the final TABLENAME as below, how this could be achieved. Pls throw some light. echo "Modified... (3 Replies)
Discussion started by: michaelrozar17
3 Replies

6. Shell Programming and Scripting

Perl: One action if an element doesn't exist in array

Hello, I want to run one (not multiple) action if an element doesn't exist in array. for example: @array = (1..10); foreach $el (@array) { if ($el != 11) { print "number not found\n"; } } the output of this simple script: number not found (3 Replies)
Discussion started by: ahmed_zaher
3 Replies

7. Shell Programming and Scripting

previous element in the array perl

Hi, How to get previous/next element in the array perl Example @queue = (1, 2 ,3 , 4); I want to get value of 1 and 2, or, 2 and 3, or 3 and 4...etc and compare to value which one is greater to do that I need to get previous and next element of array ? (1 Reply)
Discussion started by: guidely
1 Replies

8. Shell Programming and Scripting

Multiplying array element

I am trying to take all the elements of an array and multiply them by 2, and then copy them to a new array. Here is what I have i=0 for true in DMGLIST do let DMGSIZES2="${DMGSIZES}"*2 let i++ done unset i echo ${DMGSIZES2} It does the calculation correctly for the first element,... (7 Replies)
Discussion started by: nextyoyoma
7 Replies

9. UNIX for Advanced & Expert Users

Array Element

This question is for someone that's more familiar with Array Element. I need to know if the maximum array element that can be assigned is 1024 and if its so, Is there a workaround solution when the counter exceeded 1024? param_array="$param_nam" counter=$counter+1 #to avoid space... (3 Replies)
Discussion started by: cumeh1624
3 Replies

10. Shell Programming and Scripting

Awk: check element in array and it's value

Hello, I want to see if element exists in array, if so then, check it's corresponding value. Column 4 is position and column 1 is the chromosome for it. There are duplicates for one position on one chromosome. I want to check if same position exists on different chromosome: Data... (8 Replies)
Discussion started by: genome
8 Replies
asadmin-create-ssl(1AS) 					   User Commands					   asadmin-create-ssl(1AS)

asadmin-create-ssl, create-ssl - Creates the SSL element in the HTTP listener,IIOP listener, or IIOP Service SYNOPSIS
create-ssl --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] --type [http-listener|iiop-listener|iiop-service] --certname cert_name [--ssl2enabled=false] [--ssl2ciphers ssl_2_ciphers] [--ssl3enabled=true] [--ssl3tlsciphers ssl3_tls_ciphers] [--tlsenabled=true] [--tlsrollbackenabled=true] [--clientauthenabled=false] [listener_id] Creates the ssl element from the HTTP listener, IIOP listener, or IIOP service. The listener_id is not required if the --type option is iiop-service. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. --type type of service or listener that the SSL is created for. The type can be: http-listener, iiop-listener, and iiop- service. --certname nickname of the server certificate in the certificate database or the PKCS#11 token. In the certificate, the name format is tokenname:nickname. Including the tokenname: part in this attribute is optional. --ssl2enabled determines whether SSL2 is enabled. --ssl2ciphers a comma separated list of the SSL2 ciphers used. Use the prefix + to enable or -- to disable. Allowed values are: rc4, rc4export, rc2, rc2export, idea, des, desede3. If no value is specified, all supported ciphers are assumed to be enabled. --ssl3enabled determines whether SSL3 is enabled. --ssl3ciphers a comma separated list of the SSL3 ciphers used. Use the prefix + to enable or -- to disable. Allowed values are: rsa_rc4_128_md5, rsa3des_sha, rsa_des_sha, rsa_rc4_40_md5, rsa_rc2_40_md5, rsa_null_md5. Allowed TSL values are: rsa_des_56_sha, rsa_rc4_56_sha. If no value is specified, all supported ciphers are assumed to be enabled. --tlsenabled determines whether TLS is enabled. --tlsrollbackenabled determines whether TLS rollback is enabled. TLS rollback should be enabled for Microsoft Internet Explorer 5.0 and 5.5. --clientauthenabled determines whether SSL3 client authentication is performed on every request independent of ACL-based access con- trol. OPERANDS
listener_ID the ID of the listener or service that the SSL is created for. This operand is not required if the --type option is iiop-service. Example 1: Using create-ssl asadmin> create-ssl --user admin --password adminadmin --host fuyako --port 7070 --type http-listener --certname sampleCert --ssl2enabled=true --ssl2ciphers rc4,rc2,des --ssl3enabled=false --ssl3tlscipers rsa_rc4_128_md5,rsa3des_sha,rsa_des_sha, rsa_rc4_40_md5 --tlsenabled=false --tlsrollbackenabled=false --clientauthenabled=false http-listener-1 Created SSL in HTTP Listener Where: SSL is created for http-listener-1. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-delete-ssl(1AS) J2EE 1.4 SDK March 2004 asadmin-create-ssl(1AS)

Featured Tech Videos

All times are GMT -4. The time now is 08:02 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy