utility
gzip
GNU gzip compresses bytes; -n suppresses original filename and timestamp, -c writes stdout. Same bytes are tested for this fixed fixture only.
Formal Syntax & Structure
bash syntaxbash
gzip -n -c FILEReturn Value
exit status
GNU gzip compresses bytes; -n suppresses original filename and timestamp, -c writes stdout. Same bytes are tested for this fixed fixture only.
Working Example
Example Snippetbash
mkdir srcprintf 'app v1\n' > src/app.txtchmod 644 src/app.txtfor name in first second; do tar --sort=name --mtime=@0 --owner=0 --group=0 --numeric-owner -cf "$name.tar" -C src app.txt || exit 1 gzip -n -c "$name.tar" > "$name.tar.gz" || exit 1donecmp -s first.tar.gz second.tar.gz || exit 1printf 'same bytes\n'