Web lists-archives.com

Re: Shell Script Help




On Mon, 6 May 2019 18:12:55 +0200
john doe <johndoe65534@xxxxxxxx> wrote:

> On 5/6/2019 4:24 PM, Greg Wooledge 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
> >  
> 
> Putting the above as a one liner:
> 
> $ for dir in ab*/; do name=${dir%/}; enfuse --output "$name.jpg"
                                     ^
> --compression=97 "$dir"/*.jpg; done
                               ^
I added those semi-colons just as you did to make it one liner correct:
Same error.

Time to troubleshoot. I hope it's just a syntax error somewhere.

Thanks for your reply.

B