Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M myftpdumper
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Fjen Undso
  • myftpdumper
  • Merge requests
  • !4

Implement suggestions from shellcheck

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Fjen Undso requested to merge cleanup into master Apr 14, 2019
  • Overview 5
  • Commits 1
  • Changes 1

Script was run through https://www.shellcheck.net/

Some parts were not quoted or could have unwanted side effects like "rm -r /".

Remaining suggestions can be ignored IMO:

Line 106:
    declare -rg date=$(date +"%Y%m%d-%H%M%S")
                ^-- SC2155: Declare and assign separately to avoid masking return values.
 
Line 123:
        for dir in $(ls -t1 "$BACKUP_PATH" | tail -n +"$NUMBACKUPS"); do
                     ^-- SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
 
Line 137:
    if [[ $? -ne 0 ]]; then
          ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
 
Line 153:
        dbs=$(ls ./*.sql | cut -d "." -f 1 | cut -d "-" -f 1 | sort | uniq)
              ^-- SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
 
Line 188:
            [[ $? -ne 0 ]] \
               ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Edited Dec 15, 2019 by Fjen Undso
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cleanup