Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Foreach to cp files
Name: nmf Date: June 22, 2006 at 21:38:58 Pacific OS: OS x CPU/Ram: G4 Product: emac
Comment:
I'm trying to duplicate a template file into all files that have *mo.sed.
foreach is (\*mo.sed) cp ok.sed $is endeach
gives a cp error if I try ls instead of cp, it lists all the files correctly.
Summary: I'm trying to automate a task I do to copy files. I have a reference file is always something like: 2110filenamehere.prn. I want to automate the cp command I use now. Only the 2110 part of the file na...
Summary: Obviously, if you change the file structure you stated, this breaks. If this is a script you'll run often, then you probably want to change to the directory where the files reside. When it's the wa...
Summary: a way .... this korn shell should do what you want. When you are sure it works, change the cp, copy, to mv, move. No error checking; script assumes directories exist: #!/bin/ksh tempdir="/opt/app...