Backup script not working properly

Brian Dessent brian@dessent.net
Wed Oct 13 10:52:00 GMT 2004


Fredrik Persson wrote:

> All works but for the last for-loop which is responsible for deleting old
> backups such that only NUMBKPS=4 of the last backups are stored.
> 
> The problem is in 'if [ ${num} -le 0 ]' and 'else num=$((${num}-1))'. It seems
> like the num-variable can't be used as an integer. Any suggestions how to fix
> this???

On Linux, /bin/sh is /bin/bash.  This is not the case on Cygwin and
other *nixs.  The "$((...))" thing is a bash feature/extension I think,
and not found in the standard Bourne shell.  Try using the expr command
instead to do math, or change the shebang to call bash explicitly.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list