Sponsored Content
Top Forums Shell Programming and Scripting tar "--totals" writes to stderr not stdout? Post 302452821 by pludi on Monday 13th of September 2010 07:13:22 AM
Old 09-13-2010
Simply because you can tell tar to use stdout as a target file, for example when piping to a compression program it doesn't yet know about. If, for instance, tar didn't know about bzip2, you'd still be able to use it as tar -cf - * | bzip2 -9c > file.tar.bz2. The added statistics would, in this example, be compressed instead of shown. The only way around this: report to stderr instead of stdout.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing "stderr " to a subroutine..

This is perl, v5.6.1 built for MSWin32-x86-multi-thread ----------- i thought to pass the stderr to the subroutine which writes in a log file.. when i use &log_message(\*STDERR); in the log file instead of the error messages, i am getting only this word ____________::GLOB(0x1ab507c) ... (1 Reply)
Discussion started by: sekar sundaram
1 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

Adding custom mesg. when redirecting "exec 2>stderr.err" ?

Doubt regarding using "exec" command to redirect the STDERR to a file. e.g I did it this way. mystage.sh #!/bin/sh exec 2>stage.err .... .... cat stage.err mv: cannot move `/root/stage' to a subdirectory of itself, `/root/stage_old/stage' ls: *.zDB: No such file or... (0 Replies)
Discussion started by: snurani
0 Replies

4. Shell Programming and Scripting

Why stderr file descriptor redirection makes ksh's "select" construct hang.

I am trying to use one global declaration --> "exec 2>$ERR" to capture all stderr outputs that may occur anywhere in my script. Then close it at the end of the script using --> "exec 2<&-" I am using KSH on Solaris 8. KSH Version M-11/16/88i If I comment two "exec .." statements in the... (11 Replies)
Discussion started by: kchinnam
11 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Redirect stdout/stderr, except e.g. "STRING"

Hi, I'm running a program (Python) whose output I would like to redirect to a log. But the program calls a library (that I cannot change), which outputs all sorts of useless information. I would like to redirect all output from my Python program into this log, except output that matches the... (7 Replies)
Discussion started by: rswindle
7 Replies

7. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LZMA(1) 						      General Commands Manual							   LZMA(1)

NAME
lzma, unlzma, lzcat - LZMA compression and decompression tool SYNOPSIS
lzma [-123456789cdefhkLqtvV] [-S suffix] [filenames ...] unlzma [-cfhkLqtvV] [-S suffix] [filenames ...] lzcat [-fhLqV] [filenames ...] DESCRIPTION
LZMA (Lempel-Ziv-Markov chain-Algorithm) is an improved version of famous LZ77 compression algorithm. It was improved in way of maximum increasing of compression ratio, keeping high decompression speed and low memory requirements for decompressing. lzma command line tool has a similar interface to gzip(1) and bzip2(1) and is intended to make use of LZMA compression easy for the users who are already familiar with gzip and bzip2. In this manual lzma is compared mostly to bzip2 because that is currently one of the most widely used free software to compress tar files made for distribution. Comparing lzma to gzip is not practical because neither lzma nor bzip2 can compete with gzip in compression speed. On the other hand the compression ratio of gzip is worse than of lzma and bzip2. lzma provides notably better compression ratio than bzip2 especially with files having other than plain text content. The other advantage of lzma is fast decompression which is many times quicker than bzip2. The major disadvantage is that achieving the highest compression ratios requires extensive amount of system resources, both CPU time and RAM. Also software to handle LZMA compressed files is not installed by default on most distributions. When compressing or decompressing with lzma, the new file will have the same ownership information, permissions and timestamps as the orig- inal file. However the this information is not stored into the compressed file like gzip does. STREAMED VS. NON-STREAMED LZMA files can be either streamed or non-streamed. Non-streamed files are created only when the size of the file being compressed is known. In practice this means that the source file must be a regular file. In other words, if compressing from the standard input or from a named pipe (fifo) the compressed file will always be streamed. Both streamed and non-streamed files are compressed identically; the only differences are found from the beginnings and ends of LZMA com- pressed files: Non-streamed files contain the uncompressed size of the file in the LZMA file header; streamed files have uncompressed size marked as unknown. To know where to stop decoding, streamed files have a special End Of Stream marker at the end of the LZMA file. The EOS marker makes streamed files five or six bytes bigger than non-streamed. So in practice creating non-streamed files has two advantages: 1) the compressed file is a few bytes smaller and 2) the uncompressed size of the file can be checked without decompressing the file. OPTIONS
Short options can be grouped like -cd. -c --stdout --to-stdout The output is written to the standard output. The original files are kept unchanged. When compressing to the standard output there can be only one input file. This option is implied when input is read from the standard input or the script is invoked as lzcat. -d --decompress --uncompress Force decompression regardless of the invocation name. This the default when called as unlzma or lzcat. -f --force Force compression or decompression even if source file is a symlink, target exists, or target is a terminal. In contrast to gzip and bzip2, if input data is not in LZMA format, --force does not make lzma behave like cat. lzma never prompts if target file should be overwritten; existing files are skipped or, in case of --force, overwritten. -h --help Show a summary of supported options and quit. -k --keep Do not delete the input files after compression or decompression. -L --license Show licensing information of lzma. -q --quiet Suppress all warnings. You can still check the exit status to detect if a warning had been shown. -S --suffix .suf Use .suf instead of the default .lzma. A null suffix forces unlzma to decompress all the given files regardless of the filename suffix. -t --test Check the integrity of the compressed file(s). Without --verbose no output is produced if no errors are found. -v --verbose Show the filename and percentage reduction of each processes file. -V --version Show the version number of lzma. -z --compress Force compression regardless of the invocation name. -1 .. -9 Set the compression ratio. These options have no effect when decompressing. --fast Alias to -1. --best Alias to -9. DIAGNOSTICS
Exit status: 0 - Everything OK. 1 - An error occurred. 2 - Something worth a warning happened but no errors. It can be especially useful with tar(1) patched to support LZMA compression. AUTHORS
The LZMA algorithm and the implementation used in LZMA utils was developed by Igor Pavlov. The original code is available in LZMA SDK which can be found from http://7-zip.org/sdk.html . lzma command line tool was written by Ville Koskinen. http://tukaani.org/lzma/ This manual page is inspired by manual pages of gzip and bzip2. SEE ALSO
gzip(1), bzip2(1) LZMA utils 23 Dec 2005 LZMA(1)
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy