<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backup Pages on Bash Compiler Documentation</title><link>https://bash-compiler.devlab.top/backups/</link><description>Recent content in Backup Pages on Bash Compiler Documentation</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 23 May 2026 21:38:17 +0000</lastBuildDate><atom:link href="https://bash-compiler.devlab.top/backups/index.xml" rel="self" type="application/rss+xml"/><item><title>Bash Tips 6 – Embedding Files in a Single Bash Script</title><link>https://bash-compiler.devlab.top/backups/bash-tips-6--embedding-files-in-a-single-bash-script/</link><pubDate>Fri, 17 Feb 2023 00:00:00 +0000</pubDate><guid>https://bash-compiler.devlab.top/backups/bash-tips-6--embedding-files-in-a-single-bash-script/</guid><description>&lt;p&gt;Scripts that utilize multiple files are not easy to distribute. We usually distribute those as archives and rely on the
end user to unpack and run them from a predetermined location. To improve the experience we can instead prepare a single
script with other files embedded inside it.&lt;/p&gt;
&lt;p&gt;Here are the goals:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The script should consist of a single file, making it easy to distribute.&lt;/li&gt;
&lt;li&gt;The script should be copy-paste-able between systems and different editors, even if multiple hops are required.&lt;/li&gt;
&lt;li&gt;Files being embedded can be binary files i.e. can contain non-printable characters.&lt;/li&gt;
&lt;li&gt;The first requirement implies that we should somehow store the contents of other files in our main script. The second
requires us to avoid non-printable characters, as they tend to cause problems when performing a copy-paste operation.
Especially when we are talking about sending such characters over messaging programs.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="encoding"&gt;Encoding&lt;/h1&gt;
&lt;p&gt;The solution to the second and third problems is a binary-to-text encoding which encodes an array of bytes into a text
constant of printable characters. And the most commonly used encoding scheme is base64. Utils to encode to and from
base64 are included in most Linux distributions out-of-the-box.&lt;/p&gt;</description></item></channel></rss>