Foreach not looping through all items


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Foreach not looping through all items
Prev   Next
# 3  
Old 02-21-2019
the echo $subjects
provides the full list of sub-0* folders
the echo $subj-id
provides the first folder it moves to
the echo $session
provides the two ses-T* folders in that first folder
But then it exits after the first subject and going through his 2 ses-T* folders.

Last edited by IlaBert; 02-21-2019 at 01:00 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing through a list of items

Hi there, Here is my checklist of items, 4.1.1 Alerter 4.1.2 Client Services for Netware 4.1.3 Clipbook 4.1.4 Fax Service 4.1.5 File Replication 4.1.6 File Services for Macintosh 4.1.7 FTP Publishing Service 4.1.8 Help and Support 4.1.9 HTTP SSL 4.1.10 IIS Admin Service ... (1 Reply)
Discussion started by: alvinoo
1 Replies

2. Shell Programming and Scripting

Moving items to a new line

Hi, Let's I have the following strings (md5): 07177edf8261d28c6a003e583fcbe38c 0717c0037b3a20fc0f0998e673f228d5 0717d611a5d24374628b98e17fd00977,0717d611a5d24374628b98e17fd00977 07189a18afdae558bb5aadfe602e4a91 0719e97d481c239667f38a3e166bed74 071af3225fe50a1fdbb42c43aac313cc... (4 Replies)
Discussion started by: talfiq
4 Replies

3. Programming

Removing Items In A ListView

Hi everyone! So I have a listView on my Form named "officeView" I already have the code to add and update info into it, but Im having troubles deleting items out of it. :/ Now I know how to delete an Item from the listView, but I want the item before the deleted item to become automatically... (0 Replies)
Discussion started by: romeo5577
0 Replies

4. Shell Programming and Scripting

Matching 2 items in a string

Little lost here, I am trying to search a line for both values after the $ signs. My ultimate goal is to get percertage. <?php $string = "Something on sale for $4 and orginal price $10"; $strstr =. strstr($string, '$'); $strrchr =. strrchr($string, '$'); echo "$strstr<br>"; echo... (1 Reply)
Discussion started by: mrlayance
1 Replies

5. UNIX for Dummies Questions & Answers

queue items...

Hi everyone. I have a lot of programs i want to run on some data files, they need to be done sequentially. Often the output from one program is the input for the next. e.g $ progA data1 > data1.A $ progB data1.A > data1.AB $ progC data1.AB > data1.ABC repeat on data2, 3, 4, 5, 6 etc ... (4 Replies)
Discussion started by: Jay-pea
4 Replies

6. Shell Programming and Scripting

Help needed regarding first 3 items in the list

Hi, I've a list in the following format: Empdept filedetails buildingNo Area AAA 444 2 juy AAA 544 2 kui AAA 567 4 poi AAA 734 5 oiu AAA 444 ... (2 Replies)
Discussion started by: skpvalvekar
2 Replies

7. UNIX for Dummies Questions & Answers

Searching multiple items

Hi, I'm a complete newbie so bear with me. I have a directory (and sub-dirs) full of .doc, .xls files. What I'm trying to do is do a single search within the files (i.e. within each .doc etc) for occurrences of multiple items e.g. apples, pears, grapes, bananas. Basically I'd provide a... (4 Replies)
Discussion started by: kainfs
4 Replies

8. Shell Programming and Scripting

awk between items including items

OS=HP-UX ksh The following works, except I want to include the <start> and <end> in the output. awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log' The following work in bash but not in ksh sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Discussion started by: Ikon
4 Replies

9. Gentoo

Linux FAQ Items

Hello Guys, Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 64 MB to 128 MB, but there is only 128 MB of swap space. It might be advantageous to increase the amount of swap space to 256 MB if you perform... (11 Replies)
Discussion started by: prashant_ohol
11 Replies

10. Shell Programming and Scripting

Comparing items in 2 files

Hi, I have 2 files with contents in them and I need to compare each item in each file. File1: item4 item5 File2: item2 item3 item5 item6 The items names can be of different lengths. If the items in the File1 are not in File2, delete the missing item in File1. The resulting... (12 Replies)
Discussion started by: ReV
12 Replies
Login or Register to Ask a Question
Perl::Critic::Policy::Variables::RequireLexicalLoopIteraUser(Contributed Perl DocPerl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)

NAME
Perl::Critic::Policy::Variables::RequireLexicalLoopIterators - Write "for my $element (@list) {...}" instead of "for $element (@list) {...}". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
This policy asks you to use "my"-style lexical loop iterator variables: foreach my $zed (...) { ... } Unless you use "my", "for"/"foreach" loops use a global variable with its value "local" to the block. In other words, foreach $zed (...) { ... } is more-or-less equivalent to { local $zed foreach $zed (...) { ... } } This may not seem like a big deal until you see code like my $bicycle; for $bicycle (@things_attached_to_the_bike_rack) { if ( $bicycle->is_red() and $bicycle->has_baseball_card_in_spokes() and $bicycle->has_bent_kickstand() ) { $bicycle->remove_lock(); last; } } if ( $bicycle and $bicycle->is_unlocked() ) { ride_home($bicycle); } which is not going to allow you to arrive in time for dinner with your family because the $bicycle outside the loop is not changed by the loop. You may have unlocked your bicycle, but you can't remember which one it was. Lexical loop variables were introduced in Perl 5.004. This policy does not report violations on code which explicitly specifies an earlier version of Perl (e.g. "require 5.002;"). CONFIGURATION
This Policy is not configurable except for the standard options. SEE ALSO
"Foreach Loops" in perlsyn "my() in Control Structures" in perl5004delta AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07 Perl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)