0

I am trying to produce a shar file with contents kept in the clear text inside the shar-file. For the most of it things work fine, but today I met a fairly strange problem:

When I do shar -T test.tex > file.shar on the one-liner file, encoded in UTF-8:

\chapter{Séries}

everything works fine, and when executing sh file.shar the file is extracted fine and it is the same as before.

Adding a one line to it and turning the file into:

\chapter{Séries}
Séries de potências são essenciais no estudo das funções.

the same command produces a shar file that contains the text. But when we execute sh (or unshar, or change it into an executable file and execute it) it fails the MD5 check upon extraction:

$ sh file.shar
x - created lock directory _sh06764.
x - extracting test.tex (text)
test.tex: MD5 check failed
x - removed lock directory _sh06764.

and it produces a file that is recognized as ISO-8859 text and it has all accents messed up, as in:

\chapter{Séries}
S©ries de potências são essenciais no estudo das funções.

I know the manual says that you may have problems e-mailing files produced with the -T flag, but this goes beyond mailing -- the file itself is corrupted.

Can anyone share a light on what is going on?

6
  • 2
    I don't know if this is a bug or not, but I would use the mixed (-M) or binary (-B) option of shar instead of the text (-T) option for non-ASCII files.
    – FedKad
    Commented Nov 26, 2021 at 18:20
  • 1
    as per the man page's description of the -T option, "If you have files with non-ascii bytes or text that some mail handling programs do not like, you may find difficulties." Commented Nov 26, 2021 at 18:28
  • @FedonKadifeli both -M and -B produce include the files in NON editable format (uuencoded). Commented Nov 26, 2021 at 21:41
  • @steeldriver The phrase seems obviously written to mean ...you may find difficulties MAILING the file. It says right after that However, if you are using FTP or SSH/SCP, the non-conforming text files should be okay. I want to edit them with vi or emacs, so there should be no problem. Commented Nov 26, 2021 at 21:46
  • Why do you need to edit a .shar file? This seems to me like an meta.stackexchange.com/questions/66377/what-is-the-xy-problem
    – FedKad
    Commented Nov 27, 2021 at 7:42

0

You must log in to answer this question.

Browse other questions tagged .