#
# 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 ( test -f "$target" && test ! -h "$target" ) || \
- ( test -s "$target" && test ! -h "$target" ); then
- printf "link(): target '%s' exists already and is no symbolic link!" \
+ if test -e "$target" && test ! -h "$target"; then
+ printf 'link(): target "%s" exists already and is no symbolic link!\n' \
- # Make sure the source exists (is file, directory or link).
- if test ! -f "$source" && test ! -d "$source" && test ! -h "$source"; then
- printf "link(): source '%s' doesn't exist!" "$source" >&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"