Sending zip file containing plain txt file via email
13,352
To wrap the text file you can use fold
(see fold man page)
For example
fold -w 78 -s input.txt > wrapped.txt
will wrap your text to a maximum width of 78 characters. You can then use zip
to compress it
zip wrapped.zip wrapped.txt
and then send it per email with mail
mail -a wrapped.zip -s "Subject of the mail" [email protected]
(not all versions of mail support the -a
option)
Related videos on Youtube
Author by
anonymous
Updated on September 18, 2022Comments
-
anonymous over 1 year
How to send a plain txt file in a zip file via email in unix? The contents in the txt file should be word wrap.
-
Matteo about 10 yearsWhy the down vote?
-
Anthon about 10 yearsThese are multiple questions: 1) how to word wrap a text file; 2) how to zip a plain txt file; 3) how to email a zip file as an attachment. What exactly have you tried for each and what is not working?
-
Anthon about 10 years@Matteo If you hover above the down vote arrow it says "This question does not show any research effort", I think that is applicable on each of the 3 questions asked.
-