| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <416D07C8.42C3EB0F@dessent.net> |
| Date: | Wed, 13 Oct 2004 03:47:36 -0700 |
| From: | Brian Dessent <brian AT dessent DOT net> |
| Organization: | My own little world... |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Backup script not working properly |
| References: | <loom DOT 20041013T121143-79 AT post DOT gmane DOT org> |
| X-IsSubscribed: | yes |
| Reply-To: | cygwin AT cygwin DOT com |
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |