On Wednesday 14 November 2007, Chris Arnold wrote: [snip] > > After copying this into a .sh file and running with php files in the same > directory, i get find: baseDir: No such file or directory > find: name=*.php: No such file or directory > ls: /*.php: No such file or directory > sed: can't read one.php: No such file or directory > sed: can't read two.php: No such file or directory > sed: can't read foo.php: No such file or directory > sed: can't read bar.php: No such file or directory > > So it appears none of the "find" functions seem to work. Fine that the > first one, one.php and so does not work as i have 2000+ files and do not > want to hard type the filenames in. But i don't understand why the 2 other > "find" functions don't find the php files?
First of all you did run the script unmodified, while Randall clearly mentioned in his code sample alternatives, marked by "# ... or xyz" So it is EITHER > # List files, either explicitly > one.php > two.php > foo.php > bar.php OR > # ... or by using command substitution based on "find": > $( find baseDir name='*.php' ) OR > # ... or "ls": > $( ls $baseDir/*.php ) You obviously don't want the first method ;) Now you need to adapt the placeholder baseDir / $baseDir to reflect your setup. Let's use the last example, ls: ls ~/Documents/*.odt would list all *.odt files in my Documents directory (if there are any). You see, I replaced $baseDir by the actual base directory (hint hint baseDir ;) ) so change the $baseDir to your real path, and delete the other alternatives, and try again. BUT make a backup of your files first, just in case ... HTH, Matt PS. Thanks to Randall for the code, I could learn from it and use it already! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
