Web lists-archives.com

Re: Shell Script Help




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