Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

i tried the following but upon closing the preview the temporary file is not deleted. can you tell what i'm doing wrong? thank you, jose
fileviewer *.mobi,*.djvu true && tmpfile=$(mktemp --suffix=.txt) && ebook-convert %c $tmpfile >/dev/null && cat $tmpfile %pc rm $tmpfile

1 Answer

0 votes
by
edited by
 
Best answer

%pc is for graphical preview and won't work here. Looks like documentation is misleading and needs correction, thanks.

However, even if it worked $tmpfile wouldn't have any value as it is run in a separate shell.

I think replacing %pc with && is what you want (the file isn't used after it's printed out anyway, so splitting out its removal wouldn't achieve anything).

...