Re: (v) ugly (and simple) bash script...

2022-05-21 Thread john doe
On 5/21/2022 3:55 PM, Greg Wooledge wrote: On Sat, May 21, 2022 at 10:08:42AM +0100, Morgan Read wrote: I've come up with: `cd ~/Maildir/new/; for f in *; do mv -- "$f" ~/Maildir/cur/"${f%}.eml"; cd -; done` You aren't checking whether the first cd succeeds. If it fails for any reason,

Re: (v) ugly (and simple) bash script...

2022-05-21 Thread Dan Ritter
Greg Wooledge wrote: > On Sat, May 21, 2022 at 10:08:42AM +0100, Morgan Read wrote: > > I've come up with: > > `cd ~/Maildir/new/; for f in *; do mv -- "$f" ~/Maildir/cur/"${f%}.eml"; cd > > -; done` > > You aren't checking whether the first cd succeeds. If it fails for any > reason, you're

Re: (v) ugly (and simple) bash script...

2022-05-21 Thread Greg Wooledge
On Sat, May 21, 2022 at 10:08:42AM +0100, Morgan Read wrote: > I've come up with: > `cd ~/Maildir/new/; for f in *; do mv -- "$f" ~/Maildir/cur/"${f%}.eml"; cd > -; done` You aren't checking whether the first cd succeeds. If it fails for any reason, you're going to end up moving file(s) out of