You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
838 B
Plaintext

# Assign the current date (timestamp style) as a shell variable, using the Bash
# builtin, and make it a suitable filename for a Gzip-compressed Tar archive.
printf -v FileName 'Backup_%(%F_%X)T.tgz' -1
# Simple, feature-full, and portable way by which to echo(1) output to STDOUT.
# Here, the current user's username is displayed, followed by a new line.
printf '%s\n' "$USER"
# Using the Bash builtin, this will output one integer per line, from one to
# one million, in a human-readable kind of way, by appropriately
# comma-separating the units.
printf "%'d\n" {1..1000000}
# Zero-pad a number in order to maintain a width of 3 characters.
printf '%#.3d\n' 12
# As above, but instead, space-pad the number. Prefix the `3` with a hyphen
# (`-`) to left-align the number, causing the padding to occur on the right.
printf '%3d\n' 12