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

Re: Shell Script Help



On Mon, 6 May 2019 10:24:24 -0400
Greg Wooledge <wooledg@eeg.ccf.org> wrote:

> On Mon, May 06, 2019 at 06:57:00AM -0700, Patrick Bartek wrote:
> > I want a script that allows commandline only applications that can't batch
> > process to batch process.  A speciifc example. I will use the app
> > enfuse, an exposure merging program, a poor man's HDR.
> > 
> > patrick@Debian9:~/Work$ enfuse --output ab01.jpg --compression=97 ab01/DSC*.jpg
> > patrick@Debian9:~/Work$ enfuse --output ab02.jpg --compression=97 ab02/DSC*.jpg
> > :
> > :
> > patrick@Debian9:~/Work$ enfuse --output ab26.jpg --compression=97 ab26/DSC*.jpg
> > 
> > I use shell history to repeat the command for each directory, changing the
> >  --output filename and target directory numbers as necessary. Each diretory already
> > holds the appropriate image files.  
> 
> for dir in ab*/; do
>     name=${dir%/}
>     enfuse --output "$name.jpg" --compression=97 "$dir"/*.jpg
> done
> 

Typed in as a single line with a semi-colon at end of enfuse command
and before done to keep it from locking up, generates error "enfuse:
failed to open "ab*//*.jpg: No such file or directory. But it's a
beginning. Time to pull out my 400 page Unix shell programming book.

Thanks.

B


Reply to: