Skip to main content
added 56 characters in body
Source Link
m0dular
  • 1.3k
  • 7
  • 8

You aren't expandingEdit: as @StéphaneChazelas pointed out, the parameterproblem is likely that your script isn't being invoked with $COUNTbash in your arithmetic expression, so it's trying to run a commandand the COUNT(( )) and redirect that toconstruct won't work. Try running it from a file MAX_BACKUPSbash. shell or with bash my_script.sh

Also, that rm has the potential to fail spectacularly. Please read this FAQ.

You aren't expanding the parameter $COUNT in your arithmetic expression, so it's trying to run a command COUNT and redirect that to a file MAX_BACKUPS.

Also, that rm has the potential to fail spectacularly. Please read this FAQ.

Edit: as @StéphaneChazelas pointed out, the problem is likely that your script isn't being invoked with bash, and the (( )) construct won't work. Try running it from a bash shell or with bash my_script.sh

Also, that rm has the potential to fail spectacularly. Please read this FAQ.

Source Link
m0dular
  • 1.3k
  • 7
  • 8

You aren't expanding the parameter $COUNT in your arithmetic expression, so it's trying to run a command COUNT and redirect that to a file MAX_BACKUPS.

Also, that rm has the potential to fail spectacularly. Please read this FAQ.