Complete bash-script toolkit with generation and validation capabilities
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
A developer has submitted the following bash script for review. Validate it using the bash-script-validator skill's workflow and produce a corrected version.
#!/usr/bin/env bash
set -e
BACKUP_DIR=/tmp/backups
SOURCE=$1
DEST=$2
backup() {
if [ ! -f $SOURCE ]; then
echo "Source file $SOURCE not found"
exit 1
fi
mkdir -p $BACKUP_DIR
cp $SOURCE $DEST/$SOURCE
for file in $(ls $BACKUP_DIR); do
echo Processing $file
done
}
backupYour response must:
generator
validator