[ubuntu-za] Script error

Alf Stockton alf at stockton.co.za
Tue Apr 14 13:35:44 BST 2009


1.sean.riley wrote:
> I think it must look as follows;
> 
> #/bin/dash
> if [ -f /mnt/backup/mailbackups/*.dotproject.files.tar.gz ]; then
>      rm /mnt/backup/mailbackups/*.dotproject.files.tar.gz
> fi
> 
> cheers
> AcidHawk
> 
I still get ./DingDong.sh: line 2: [: too many arguments.
BTW I believe that one can use either way of writing bash/dash scripts. Your 
way allows multiple commands on one line, the ; marks the end of a command, 
whereas my way has one command per line.
> 
> 
> Alf Stockton wrote:
>> I have the following commands in DingDong.sh test file
>>
>> #/bin/dash
>> if [ -f /mnt/backup/mailbackups/*.dotproject.files.tar.gz ]
>>      then
>>      rm /mnt/backup/mailbackups/*.dotproject.files.tar.gz
>> fi
>>
>> and I keep getting the error:-
>>
>> ./DingDong.sh: line 2: [: too many arguments
>>
>> Please tell me how I got this wrong.
>>
>>   


-- 
Regards,
Alf Stockton		www.stockton.co.za

Your object is to save the world, while still leading a pleasant life.



More information about the ubuntu-za mailing list