Archives and Compression
Tar Create
Build an Archive Command
Archive commands collect multiple paths into one file. A script can assemble the command from fixed inputs before running it.
Program
Play the script to choose the archive name and build the command text deterministically.
tar_create_plan.sh
#!/usr/bin/env bash
archive=
files=("index.html" "style.css" "app.js")
file_list="${files[*]}"
command="tar -cf $archive $file_list"
echo "$command"
#!/usr/bin/env bash
archive=
files=("index.html" "style.css" "app.js")
file_list="${files[*]}"
command="tar -cf $archive $file_list"
echo "$command"
#!/usr/bin/env bash
archive=
files=("index.html" "style.css" "app.js")
file_list="${files[*]}"
command="tar -cf $archive $file_list"
echo "$command"
archive
A tar archive groups paths into one file.
array expansion
`"${files[*]}"` joins array elements with spaces for display.
command plan
This example builds command text without touching the filesystem.