recentpopularlog in

therobyouknow : iterate   5

Recursive Linux "Find Files Containing" : Joe Grossberg
find . -name '*.*' -exec grep -i -H -n 'string_to_search' {} \;
Make sure path expression is in single quotes e.g.'*.*' and so is string to search
cli  command  find  grep  howto  linux  recursive  script  search  unix  look  lookfor  directory  folder  subfolder  leaf  iterate  hierarchy  path  within  contains  inside  string  computing  work 
july 2010 by therobyouknow
Print an array one element per line, with line numbering - Perl Circus - Perl Tricks, Tips And Traps.
in a foreach (@array), $_ *refers* to the element being looked at in an iteration. writing to $_ modifies the element in the original array - update in-place. This enables efficiency if passing the array around for stages of processing, rather than working with copies - and also ensures that the original data is updated (if that's what is required)
programming  tutorial  perl  inspiration  array  $_  in-place  inplace  update  within  loop  foreach  reference  efficiency  efficient  howto  computing  work  language  tip  iterate  alias  element  modify  original 
september 2009 by therobyouknow

Copy this bookmark:





to read