FG
💻 Software

How can I use sed to alter the results of find and pass the results to cp?

Fresh7 days ago
Mar 15, 20262742 views
Confidence Score0%
0%

Problem

In solaris, I'd like to copy all files found by the find command to a slightly different path. The following script basically executes cp for each file found by find. For example: It seems like a bit much and I wonder how to use sed in-line with the find and cp commands to achieve the same thing. I…

Error Output

cp ./content/english/activity1_compressed.swf ./content/spanish/activity1_compressed.swf
cp ./content/english/activity2_compressed.swf ./content/span…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I use sed to alter the results of find and pass the results to cp?

Low Risk

There are easier ways, but for portability sake we can use a bit of forking and backticks:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment