Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Traveller''s Lunchbox

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 59 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       shar [ options ] file ...
       shar -S [ options ]


       Shar creates "shell archives" (or shar files) which are in
       text format  and  can  be  mailed.   These  files  may  be
       unpacked  later  by  executing  them  with  /bin/sh.   The
       resulting archive is sent to standard out  unless  the  -o
       option  is given.  A wide range of features provide exten­
       sive flexibility in manufacturing shars and in  specifying
       shar "smartness".  Archives may be "vanilla" or comprehen­


       Options have a one letter version starting  with  -  or  a
       long  version  starting with --.  The exception is --help,
       --version,  --no-i18n  and  --print-text-domain-dir  which
       does not have short versions.  Mandatory arguments to long
       options are mandatory for short options too.  Options  can
       be given in any order.  Some options depend on each other:
            The -o option is required if the -l or -L option is used.
            The -n option is required if the -a option is used.
            See -V below.

   Giving feedback:
       --help Print a help summary on standard output, then imme­
              diately exits.

              Print the version number of the program on standard
              output, then immediately exits.

       -q --quiet --silent
              Do not output verbose messages locally when produc­
              ing the archive.

   Selecting files:
       -p  --intermix-type
              Allow  positional  parameter  options.  The options
              -B, -T, -z and -Z may be embedded, and files to the
              right of the option will be processed in the speci­
              fied mode.

       -S  --stdin-file-list
              Read list of files to be packed from  the  standard
              input  rather  than  from  the command line.  Input
              must be in a form similar to that generated by  the
              find  command,  one filename per line.  This switch
              is especially useful when the command line will not
              hold the list of files to be packed.  For example:

       -l XX  --whole-size-limit=XX
              Limit  the  output file size to XXk bytes but don't
              split input files.

       -L XX  --split-size-limit=XX
              Limit output file size to XXk bytes and split files
              if  necessary.  The archive parts created with this
              option must be unpacked in correct order.

   Controlling the shar headers:
       -n name  --archive-name=name
              Name of archive to be included in the header of the
              shar files.  See the -a switch.

       -s who@where  --submitter=who@where
              Override automatically determined submitter name.

       -a  --net-headers
              Allows automatic generation of headers:
                   Submitted-by: who@where
                   Archive-name: <name>/part##
              The  <name>  must  be given with the -n switch.  If
              name includes a '/' "/part" isn't used.  Thus:
                 -n xyzzy                      produces:

                 -n xyzzy/patch                produces:

                 -n xyzzy/patch01.             produces:

              The who@where can be explicitly stated with the  -s
              switch if the default isn't appropriate.  Who@where
              is essentially built as `whoami`@`uname`.

       -c  --cut-mark
              Start the shar with a cut line.  A line saying 'Cut
              here' is placed at the start of each output file.

   Selecting how files are stocked:
       -M  --mixed-uuencode
              Mixed  mode.   Determine  if  the files are text or
              binary  and  archive  correctly  (default).   Files
              found  to  be binary are uudecoded prior to packing

       -T  --text-files

       -g LEVEL  --level-for-gzip=LEVEL
              When doing compression, use '-LEVEL' as a parameter
              to gzip.  Default is 9.  The -g option turns on the
              -z option by default.

       -Z  --compress
              Compress and uuencode all files prior  to  packing.
              The  recipient  must  have uudecode and compress in
              order to unpack (USE OF UUENCODE  AND  COMPRESS  IS
              NOT  APPRECIATED BY MANY ON THE NET).  Option -C is
              synonymous to -Z, but is being deprecated.

       -b BITS  --bits-per-code=BITS
              When doing compression, use '-bBITS' as a parameter
              to  compress.  The -B option turns on the -Z option
              by default.  Default value is 12.

   Protecting against transmission errors:
       -w  --no-character-count
              Do NOT check each file with 'wc -c'  after  unpack.
              The default is to check.

       -D  --no-md5-digest
              Do  NOT  use 'md5sum' digest to verify the unpacked
              files. The default is to check.

       -F  --force-prefix
              Forces the prefix character  (normally  'X'  unless
              the  parameter to the -d option starts with 'X') to
              be prepended to every line even  if  not  required.
              This  option  may slightly increase the size of the
              archive, especially if -B or -Z is used.

       -d XXX  --here-delimiter=XXX
              Use XXX to delimit the files in the shar instead of
              SHAR_EOF.   This is for those who want to personal­
              ize their shar files.

   Producing different kinds of shars:
       -V  --vanilla-operation
              Produce "vanilla" shars which rely  only  upon  the
              existence of sed and echo in the unsharing environ­
              ment.  In addition, "if test"  must  also  be  sup­
              ported  unless  the  -x  option  is  used.   The -V
              silently disables options offensive to the "network
              cop" (or "brown shirt"), but does warn you if it is
              specified with -B, -z, -Z, -p or -M (any  of  which
              does or might require uudecode, gzip or compress in
              the unsharing environment).

       -P  --no-piping

       -X  --query-user
              When unpacking, interactively ask the user if files
              should  be overwritten.  (DO NOT USE FOR SHARS SUB­
              MITTED TO THE NET).

       -m  --no-timestamp
              Avoid generating 'touch' commands  to  restore  the
              file  modification  dates when unpacking files from
              the archive.

       -Q  --quiet-unshar
              Verbose OFF.  Disables the inclusion of comments to
              be output when the archive is unpacked.

       -f  --basename
              Restore  by  filename only, rather than path.  This
              option causes only file names to be used, which  is
              useful  when  building a shar from several directo­
              ries, or another directory.  Note that if a  direc­
              tory  name  is  passed to shar, the substructure of
              that directory will be restored whether -f is spec­
              ified or not.

              Do  not  produce  internationalized shell archives,
              use default english  messages.   By  default,  shar
              produces  archives that will try to output messages
              in the unpackers preferred language (as  determined
              by  the  LANG/LC_MESSAGES  environmental variables)
              when they are unpacked.  If no message file for the
              unpackers  language  is  found at unpack time, mes­
              sages will be in english.

              Prints the directory shar looks in to find messages
              files  for  different  languages,  then immediately


       shar *.c > cprog.shar                # all C prog sources
       shar -Q *.[ch] > cprog.shar          # non-verbose, .c and .h files
       shar -B -l28 -oarc.sh *.arc          # all binary .arc files, into
                                            # files arc.sh.01 thru arc.sh.NN
       shar -f /lcl/src/u*.c > u.sh         # use only the filenames


       No chmod or touch is ever generated for  directories  cre­
       ated  when  unpacking.   Thus,  if a directory is given to
       shar, the protection and modification dates of correspond­
       ing  unpacked  directory may not match those of the origi­

       Use of -X produces shars which WILL  cause  problems  with
       many   unshar  procedures.   Use  this  feature  only  for
       archives to be passed among agreeable parties.  Certainly,
       -X  is NOT for shell archives which are to be submitted to
       Usenet.  Usage of -B, -z or -Z in net shars will cause you
       to  be flamed off the earth.  Not using -m or not using -F
       may also get you occasional complaints.




       Error messages for illegal or  incompatible  options,  for
       non-regular,   missing   or   inaccessible  files  or  for
       (unlikely) memory allocation failure.


       The shar and unshar programs is  the  collective  work  of
       many  authors.  Many people contributed by reporting prob­
       lems, suggesting various improvements or submitting actual
       code.  A list of these people is in the THANKS file in the
       sharutils distribution.

                        September 10, 1995                SHAR(1)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can help in many different ways.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds