Sponsored Content
Top Forums Shell Programming and Scripting previous element in the array perl Post 302559094 by yazu on Monday 26th of September 2011 08:00:20 AM
Old 09-26-2011
Code:
perl -e '
@queue = (1, 2, 3, 4);
print for map { "$queue[$_], $queue[$_+1]\n" } 0...$#queue-1'
1, 2
2, 3
3, 4

But I think I didn't understand you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

accessing my first element of array

Hello everyonel, I have an array set like so num=4 read name arr=name I go through while loop to assign different values to different array element from 1 to 4. when I try to access the FIRST element of the array I get the last one first. Like if I say ${arr} it will show the last element... (4 Replies)
Discussion started by: afadaghi
4 Replies

2. 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

3. 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

4. Shell Programming and Scripting

Shift array element

I want to delete and 0th element of array in shell scrpit and also shift all others to one level up. (2 Replies)
Discussion started by: darshakraut
2 Replies

5. Shell Programming and Scripting

HELP unsetting array element in loop

I have a loop and I need to be able to unset the array element that I am currently accessing in it. I was thinking of making a counter that increments with the loop and doing unset $dirs but if I do that I am not sure if the other members of the array would get shifted down in index (meaning that... (2 Replies)
Discussion started by: msf5042
2 Replies

6. 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

7. 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

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. Shell Programming and Scripting

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 http-listener-1 http-listener-2 http-listener-3 http-listener-4 If i send http-listener-3 my... (1 Reply)
Discussion started by: javaholics
1 Replies

10. 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
queue-repair(8) 					      System Manager's Manual						   queue-repair(8)

NAME
queue-repair - deal with the qmail queue directory structure SYNOPSIS
queue-repair [ -htrcbn ] [ -n split ] [ conf-qmail ] DESCRIPTION
queue-repair deals with the qmail queue structure; it can create a new queue, move and properly rename a queue, dynamically change the conf-split value, convert big-todo queues to non-big-todo and vice versa, and repair a corrupted queue. conf-qmail defaults to /var/lib/qmail/ on Debian. OPTIONS
-h|--help Display usage information and built-in defaults, then exit. -t|--test Run in test-only mode. queue-repair will attempt to report all problems that it finds, without correcting them. This is the default. -r|--repair Run in repair mode. queue-repair will attempt to correct all problems that it finds, except if the basic queue directories (queue, queue/mess, queue/info, etc) are not found. -c|--create Run in create-and-repair mode. queue-repair will attempt to correct all problems that it finds, including creation of a new queue structure from scratch. -s|--split split Specify split as the value of conf-split. This is the number of split subdirectories for those queue directories which are hashed. The default for qmail is 23. Appropriate values depend on the volume of mail handled, OS filesystem efficiency, and other factors, but this should always be a prime number. If you do not specify conf-split, queue-repair will attempt to determine the current value from the existing queue. This option can be used, however, to change the conf-split value of an existing queue (qmail will still have to be recompiled with the new value). When creating a new queue, this option must always be specified. -b|--bigtoto Use big-todo. queue-repair should be able to automatically determine if you're using qmail patched with the big-todo patch. This option can be used, however, to convert a non-big-todo queue to a big-todo queue (qmail will still have to be recompiled with the big-todo patch). If neither this option nor --no-bigtodo is used, queue-repair will attempt to determine this automatically. When creating a new queue, either this option or --no-bigtodo must always be specified. -n|--no-bigtodo Do not use big-todo. queue-repair should be able to automatically determine if you're using qmail patched with the big-todo patch. This option can be used, however, to convert a big-todo queue to a non big-todo queue (qmail will still have to be recompiled with- out the big-todo patch). If neither this option nor --bigtodo is used, queue-repair will attempt to determine this automatically. When creating a new queue, either this option or --bigtodo must always be specified. --i-want-a-broken-conf-split Force the use of a non-prime value for conf-split. SEE ALSO
qmail(7) queue-repair(8)
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy