]> The Tcpdump Group git mirrors - tcpdump/commit
TESTrun: clean up printing of files.
authorGuy Harris <[email protected]>
Sat, 13 Jun 2020 07:08:49 +0000 (00:08 -0700)
committerGuy Harris <[email protected]>
Sat, 13 Jun 2020 07:08:49 +0000 (00:08 -0700)
commitf28d5b06872ae9ab7dd9216f9cd56cba1ec7178b
treeb83e75cf0dfa60dbf210e3ddd4fd22f8b9137c83
parent27ede6609cad295a3100fe7c11fca35192da8d74
TESTrun: clean up printing of files.

Many Windows commands only accept paths using backslashes, because
slashes are option separators.

Add a showfile() function that takes a pathname as an argument and:

on Windows, converts the pathname to canonical form - which
means any slashes will be converted to backslashes - and run
"type" on it;

on UN*X, run "cat" on it.

Convert

cat foo | diff bar -

to

diff bar foo

to avoid using cat at all.  (Note also that the closest built-in Windows
equivalent of diff, fc, does *not* support reading the standard input as
one of the files to compare, so it also will avoid that when we change
those to use fc on Windows.)

The one remaining use of cat is in a command with pathnames, so use a
type command, with backslash-separated paths, on Windows, and cat, with
slash-separated paths, on UN*X.

We might just want to do that directly in Perl; add a comment about
that.
tests/TESTrun