From ecc14d13d482f4a0a295088d8748096bfb3068bd Mon Sep 17 00:00:00 2001 From: tcweave04 Date: Thu, 14 Nov 2024 14:33:19 -0500 Subject: [PATCH] =?UTF-8?q?Created=20=E2=80=9DErrorCode=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ”ErrorCode.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ”ErrorCode.md diff --git a/”ErrorCode.md b/”ErrorCode.md new file mode 100644 index 0000000..0b67255 --- /dev/null +++ b/”ErrorCode.md @@ -0,0 +1,15 @@ +##Solution #!/bin/bash +## Example: ShellCheck can detect many different kinds of quoting issues +if ! grep -q "backup=true.*" "$HOME/.myconfig" +then +echo "Backup not enabled in $HOME/.myconfig, exiting" +exit 1 +fi +if [[ $1 =~ -v(erbose)? ]] +then +verbose=(-printf "Copying %f\n") +fi +find backups/ \ +-iname '*.tar.gz' \ +"${verbose[@]}" \ +-exec scp {} 'myhost:backups' + \ No newline at end of file