Web lists-archives.com

Re: Shell Script Help

On 5/4/2019 5:08 PM, Patrick Bartek wrote:
> Hi! All,
> Want to create a simple, one liner to type in to automate what I've
> been doing manually: Perform an operation on files in unique,
> sequential directories, save the results of the operations for each
> directory with a file name of that directory in the directory the
> target directories reside in.  For example:
> Directories ab01, ab02 ... ab30 results in output
> ab01.jpg. ab02.jpg ... ab30.jpg outside of those drectories.
> There will never be more than 99 directories -- usually a lot less. The
> actual number will vary job to job. The letters in the directory names
> will vary job to job, but will remain constant for each job.  Only the
> numbers will sequence.

Would something like the following do it:

$ mkdir -p abc; cp -v abc*.gpg abc/ | tee -a abc/abc.log

John Doe