<html><head></head><body><div style="font-family:courier new, courier, monaco, monospace, sans-serif;font-size:16px;"><div style="font-family:courier new, courier, monaco, monospace, sans-serif;font-size:16px;"><div></div>
        <div><span><div style="color: rgb(0, 0, 0); font-family: "courier new", courier, monaco, monospace, sans-serif; font-size: 16px;"><span><div><span><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">On Thursday, June 7, 2018, 11:42:26 PM EDT, rlharris@oplink.net <rlharris@oplink.net> wrote:</div><div><br></div></span></div><div> <span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;">> </span></span><span style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">My need is to write a string to each file in a directory (the same string,</span><span><div dir="ltr" style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">> such as, "project xyz", needs to be written to each file).  The files have<br></div><div dir="ltr" style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;">> </span></span>been created with "touch", run from a bash script; so the file length is<br></div><div dir="ltr" style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;">> </span></span>zero.  My system is Debian.</div><div dir="ltr" style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><br></div></span></div><div>No need for Perl when a simple Bash for loop will do.</div><div><br></div><div> <span><div>[temp]$ ls -l</div><div>total 0</div><div>-rw-rw-r--. 1 0 Jun  8 13:24 x.txt</div><div>-rw-rw-r--. 1 0 Jun  8 13:24 y.txt</div><div>-rw-rw-r--. 1 0 Jun  8 13:24 z.txt</div><div><br></div><div>[temp]$ for F in `ls`; do echo project.xyz > $F; done</div><div><br></div><div>[temp]$ ls -l</div><div>total 12</div><div>-rw-rw-r--. 1 12 Jun  8 13:24 x.txt</div><div>-rw-rw-r--. 1 12 Jun  8 13:24 y.txt</div><div>-rw-rw-r--. 1 12 Jun  8 13:24 z.txt</div><div><br></div><div>[temp]$ more *</div><div>::::::::::::::</div><div>x.txt</div><div>::::::::::::::</div><div>project.xyz</div><div>::::::::::::::</div><div>y.txt</div><div>::::::::::::::</div><div>project.xyz</div><div>::::::::::::::</div><div>z.txt</div><div>::::::::::::::</div><div>project.xyz</div><div><br></div></span>However, in Perl Path::Class::dir->spew is nice</div></span></div></span></div><div><br></div><div><span><div>[temp]$ perl -MPath::Class=dir -e '$_->spew("project.xyz2") foreach  <span><span style="color: rgb(0, 0, 0); font-family: "courier new", courier, monaco, monospace, sans-serif; font-size: 16px;">dir(".")</span></span>->children;'</div><div><br></div><div>[temp]$ more *</div><div>::::::::::::::</div><div>x.txt</div><div>::::::::::::::</div><div>project.xyz2</div><div>::::::::::::::</div><div>y.txt</div><div>::::::::::::::</div><div>project.xyz2</div><div>::::::::::::::</div><div>z.txt</div><div>::::::::::::::</div><div>project.xyz2</div><div><br></div></span></div></div></div></body></html>