Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Get the result of the last glob



Aryn Starr wrote on Wed, 21 Aug 2019 13:22 +00:00:
> ebook-convert * *.epub

Assuming emacs keybindings, you can do:

ebook-convert *<TAB>{,.epub}

(where <TAB> will expand the glob)

or

ebook-convert * *<Ctrl+X>*.epub

(where "<Ctrl+X>*" is the default binding for the expand-word widget, which will expand the glob)

or even

() { for 1; do ebook-convert $1 $1.epub; done } *

which, unlike the previous examples, works for any number of files.  (It's an anonymous function with arguments.)

> Which I want expanded to:
> 
> ebook-convert somebook.mobi somebook.mobi.epub
>



Messages sorted by: Reverse Date, Date, Thread, Author