[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell Script Help



* Patrick Bartek <patrick.bartek@gmail.com> [19-05/04=Sa 08:08 -0700]:
> [...] Perform an operation on files in unique, sequential
> directories [...] never more than 99 -- usually a lot
> less.  The actual number will vary job to job.  [...]

If the sequentially-numbered directories already exist:
  `man find`
Else:
  for ((i=1;i<12;++i));{ printf frob%02d\\n $i;} # tested: Bash 3 & 4

* Patrick Bartek <patrick.bartek@gmail.com> [19-05/04=Sa 08:08 -0700]:
> 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. 


Reply to: