#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Usage: cmd_i <cmd> ... <file>
#
# Run <cmd> with all arguments (including the last file) and write the result
# Usage: cmd_i <cmd> ... <file>
#
# Run <cmd> with all arguments (including the last file) and write the result
# If an unsupported OS is used an error is printed.
os() {
if test -f /etc/debian_version; then
echo debian
elif test -f /etc/gentoo-release; then
echo gentoo
# If an unsupported OS is used an error is printed.
os() {
if test -f /etc/debian_version; then
echo debian
elif test -f /etc/gentoo-release; then
echo gentoo
- if ( test -f "$target" && test ! -h "$target" ) || \
- ( test -s "$target" && test ! -h "$target" ); then
- echo "link(): target '$target' exists already and is no symbolic link!" >&2
+ if test -e "$target" && test ! -h "$target"; then
+ printf 'link(): target "%s" exists already and is no symbolic link!\n' \
+ "$target" >&2
- # Make sure the source exists (is file, directory or link).
- if test ! -f "$source" && test ! -d "$source" && test ! -h "$source"; then
- echo "link(): source '$source' doesn't exist!" >&2
+ # Make sure the source exists.
+ if test ! -e "$source"; then
+ printf 'link(): source "%s" does not exist!\n' "$source" >&2
# Generate a file from a source file using a given command. A warning not to
# edit it is automatically added to the created file.
#
# Generate a file from a source file using a given command. A warning not to
# edit it is automatically added to the created file.
#
"$file" "$file$extension" "$1"
echo '###################################' >"$file"
echo '# WARNING! DO NOT EDIT THIS FILE! #' >>"$file"
echo '###################################' >>"$file"
echo >>"$file"
"$file" "$file$extension" "$1"
echo '###################################' >"$file"
echo '# WARNING! DO NOT EDIT THIS FILE! #' >>"$file"
echo '###################################' >>"$file"
echo >>"$file"