I am just stucked in syntax.This is more like a array and for loop problem.
I want to use ls -l command and get filezise and filename of all filenames in the directory in an array (say array#1).
After 2 minutes of sleep, i want to get the same information in another array (say array#2).
The... (4 Replies)
- I m retreving values from database and wish to use those values later in my shell script. I m placing these values in an array da_data but outside loop array is empty.Problem is its treating array as local inside loop hence array is empty outside loop.
Plz go through the script and suggest how... (1 Reply)
Hello!
I have a question about loops and arrays. I'm trying to go through this:
for aa in 01 02 03
OrigNum=$(grep ${Orig} Ba3In2F12.prepos | wc -l)
OrigNum=$((${OrigNum} - 1))
echo ${OrigNum}
etc
It gets stuck on the second line. The error reads:
./asdf: line 30:... (5 Replies)
Hi
I have something like
cat $HOME/all_dirs | while read ln_old_dirs
do
if
then
echo "$ln_all_old_dirs"
fi
done
As you know that the variable ln_all_old_dirs is not accessable from outside the... (2 Replies)
Hi everyone:)
I have 2 files - IN & OUT. Example:
IN
A:13:30
B:45:40
.
.
. UNLIMITED
OUT
Z:12:24
Y:20:15
.
.
. UNLIMITED
I want first row of numbers of IN - OUT. Example 13-12 45-20
My code is (2 Replies)
I've got this problem, if I modify an array in the loop and print it, everything is fine as long as I stay in the loop. But, when I print it outside the loop, nothing happens... How can I solve this problem?
Here I prepared a sample for you to see my problem;
zgrw@Rain:~$ cat test
asd
123... (4 Replies)
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Hi, I have the following problem that is beyond what I can currently do with bash scripting.
In file 1, I have ~ 2500000 values. Note this file is not sorted.
3 19 LABEL_A
3 37 LABEL_B
2 12 LABEL_C
1 15 LABEL_D
I have a list of values in "file 2" ~ 25000 unique lines:
Note -... (6 Replies)
Hi there,
A bit new to bash and am having an issue with a for loop. I look for filenames in a specified directory and pull the date string from each meeting a certain criteria, and then would like to make a directory for each date found, like this:
search 20180101.gz 20180102.gz 20180103.gz... (5 Replies)
Discussion started by: mwheeler12
5 Replies
LEARN ABOUT DEBIAN
test::data::array
Array(3pm) User Contributed Perl Documentation Array(3pm)NAME
Test::Data::Array -- test functions for array variables
SYNOPSIS
use Test::Data qw(Array);
DESCRIPTION
Functions
array_any_ok( ITEM, ARRAY [, NAME] )
Ok if any element of ARRAY is ITEM.
array_none_ok( ITEM, ARRAY [, NAME] )
Ok if no element of ARRAY is ITEM.
array_once_ok( ITEM, ARRAY [, NAME] )
Ok if only one element of ARRAY is ITEM.
array_multiple_ok( ITEM, ARRAY [, NAME] )
Ok if more than one element of ARRAY is ITEM.
array_max_ok( NUMBER, ARRAY [, NAME] )
Ok if all elements of ARRAY are numerically less than or equal to NUMBER.
array_min_ok( NUMBER, ARRAY [, NAME] )
Ok if all elements of ARRAY are numerically greater than or equal to NUMBER.
array_maxstr_ok( ITEM, ARRAY [, NAME] )
Ok if all elements of ARRAY are asciibetically less than or equal to MAX.
array_minstr_ok( ITEM, ARRAY [, NAME] )
Ok if all elements of ARRAY are asciibetically greater than or equal to MAX.
array_sum_ok( SUM, ARRAY [, NAME] )
Ok if the numerical sum of ARRAY is SUM.
array_empty_ok( ARRAY [, NAME] )
Ok if the array contains no elements.
array_length_ok( ARRAY, LENGTH [, NAME] )
Ok if the array contains LENGTH number of elements.
array_sortedstr_ascending_ok( ARRAY, [, NAME] )
Ok if each succeeding element is asciibetically greater than or equal to the one before.
array_sortedstr_descending_ok( ARRAY, [, NAME] )
Ok if each succeeding element is asciibetically less than or equal to the one before.
array_sorted_ascending_ok( ARRAY, [, NAME] )
Ok if each succeeding element is numerically greater than or equal to the one before.
array_sorted_descending_ok( ARRAY, [, NAME] )
Ok if each succeeding element is numerically less than or equal to the one before.
SEE ALSO
Test::Data, Test::Data::Scalar, Test::Data::Function, Test::Data::Hash, Test::Builder
SOURCE AVAILABILITY
This source is in Github:
http://github.com/briandfoy/test-data/tree/master
AUTHOR
brian d foy, "<bdfoy@cpan.org>"
COPYRIGHT AND LICENSE
Copyright (c) 2002-2009 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2009-02-12 Array(3pm)