That happens, because usually Vim switches to the alternate screen and works there. Upon exiting, Vim will switch back and therefore you don't see anything left from your Vim session, but the result of the command executed even before starting Vim.
This feature is explained at :h xterm-screens (link)
So you basically don't want that and therefore want to disable that. You can do so, by setting :set t_ti= t_te= the terminal codes that perform this to empty.
Putting it all together, you would want to start Vim like this:
vim -c ':set t_ti= t_te= nomore' -c 'scriptnames|q!'
We are resetting the 'more' option, so that you don't see the hit-enter-prompt.
lessare there for. Just pipe it into less like sovim -c ':set t_ti= t_te= nomore' -c 'scriptnames|q!' | less. The layout maybe screwed up at first (it's in my terminal), but after pressingvim -c ':set t_ti= t_te= nomore' -c 'scriptnames|q!', there is only a "quick flash", the command exit with code 0, no output. Am I missing something? – TrungDQ Dec 04 '17 at 03:50