Memoize

BasicWerk   EC Support   Technique   Facebook  

20140605211628_zsh_filepattern

zsh

 

% mkdir d{1,2,3}
% ls
d1/	d2/	d3/
% touch f{1,2,3}.txt
% ls
d1/	d2/	d3/	f1.txt	f2.txt	f3.txt
 
% foreach x (`ls`)
    if [[ -f $x ]] then
        echo $x
    fi
  end
# ->
  f1.txt
  f2.txt
  f3.txt

 


© Shin Nakamura/BasicWerk 2014