1unshar(1) User Commands unshar(1)
2
3
4
6 unshar - unpack a shar archive
7
9 unshar [-flags] [-flag [value]] [--option-name[[=| ]value]] [<file>...]
10
11 The operands that this program operates on may be specified either on
12 the command line or read from standard input, one per line. In that
13 input, leading and trailing white space is stripped, blank lines are
14 ignored. Standard input may not be a terminal.
15
16
18 Unshar scans the input files (typically email messages) looking for the
19 start of a shell archive. If no files are given, then standard input
20 is processed instead. It then passes each archive discovered through
21 an invocation of the shell program to unpack it.
22
23 This program will perform its function for every file named on the com‐
24 mand line or every file named in a list read from stdin. The arguments
25 or input names must be pre-existing files. The input list may contain
26 comments, which are blank lines or lines beginning with a '#' charac‐
27 ter.
28
30 -d dir, --directory=dir
31 unpack into the directory dir.
32
33 The input file names are relative to the current directory when
34 the program was started. This option tells unshar to insert a
35 cd <dir> commad at the start of the shar text written to the
36 shell.
37
38 -c, --overwrite
39 overwrite any pre-existing files.
40
41 This option is passed through as an option to the shar file.
42 Many shell archive scripts accept a -c argument to indicate that
43 existing files should be overwritten.
44
45 -f, --force
46 This is an alias for the --overwrite option.
47
48 -E split-mark, --split-at=split-mark
49 split input on split-mark lines. The default split-mark for
50 this option is:
51 exit 0
52
53 With this option, unshar isolates each different shell archive
54 from the others which have been placed in the same file, unpack‐
55 ing each in turn, from the beginning of the file to the end.
56 Its proper operation relies on the fact that many shar files are
57 terminated by a readily identifiable string at the start of the
58 last line.
59
60 For example, noticing that most `.signatures' have a double
61 hyphen ("--") on a line right before them, one can then some‐
62 times use --split-at=--. The signature will then be skipped,
63 along with the headers of the following message.
64
65 -e, --exit-0
66 split input on "exit 0" lines. This option must not appear in
67 combination with any of the following options: split-at.
68
69 Most shell archives end with a line consisting of simply "exit
70 0". This option is equivalent to (and conflicts with) --split-
71 at="exit 0".
72
73 -D, --debug
74 debug the shell code.
75
76 "set -x" will be emitted into the code the shell interprets.
77
78 -h, --help
79 Display usage information and exit.
80
81 -!, --more-help
82 Pass the extended usage information through a pager.
83
84 -R [cfgfile], --save-opts [=cfgfile]
85 Save the option state to cfgfile. The default is the last con‐
86 figuration file listed in the OPTION PRESETS section, below.
87 The command will exit after updating the config file.
88
89 -r cfgfile, --load-opts=cfgfile, --no-load-opts
90 Load options from cfgfile. The no-load-opts form will disable
91 the loading of earlier config/rc/ini files. --no-load-opts is
92 handled early, out of order.
93
94 -v [{v|c|n --version [{v|c|n}]}]
95 Output version of program and exit. The default mode is `v', a
96 simple version. The `c' mode will print copyright information
97 and `n' will print the full copyright notice.
98
100 Any option that is not marked as not presettable may be preset by load‐
101 ing values from configuration ("RC" or ".INI") file(s). The file
102 "$HOME/.sharrc" will be used, if present.
103
105 See OPTION PRESETS for configuration files.
106
108 One of the following exit values will be returned:
109
110 0 (EXIT_SUCCESS)
111 Successful program execution.
112
113 1 (EXIT_FAILURE)
114 There was an error in command usage.
115
116 2 (EXIT_POPEN_PROBLEM)
117 cannot spawn or write to a shell process
118
119 3 (EXIT_CANNOT_CREATE)
120 cannot create output file
121
122 4 (EXIT_BAD_DIRECTORY)
123 the working directory structure is invalid
124
125 5 (EXIT_NOMEM)
126 memory allocation failure
127
128 6 (EXIT_INVALID)
129 invalid input, does not contain a shar file
130
131 66 (EX_NOINPUT)
132 A specified configuration file could not be loaded.
133
134 70 (EX_SOFTWARE)
135 libopts had an internal operational error. Please report it to
136 autogen-users@lists.sourceforge.net. Thank you.
137
139 shar(1)
140
142 The shar and unshar programs is the collective work of many authors.
143 Many people contributed by reporting problems, suggesting various
144 improvements or submitting actual code. A list of these people is in
145 the THANKS file in the sharutils distribution.
146
148 Copyright (C) 1994-2015 Free Software Foundation, Inc. all rights
149 reserved. This program is released under the terms of the GNU General
150 Public License, version 3 or later.
151
153 Please put sharutils in the subject line for emailed bug reports. It
154 helps to spot the message.
155
156 Please send bug reports to: bug-gnu-utils@gnu.org
157
159 This manual page was AutoGen-erated from the unshar option definitions.
160
161
162
163GNU sharutils (4.15.2) 30 May 2015 unshar(1)