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.

the proper way to convert a file to tempfile and delete it after preview

0 votes
asked Jul 20 in vifm by jose

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
answered Jul 20 by xaizek
edited Jul 21 by xaizek
 
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).

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...