[ubuntu-za] Script error
alf at stockton.co.za
Tue Apr 14 13:35:44 BST 2009
> I think it must look as follows;
> if [ -f /mnt/backup/mailbackups/*.dotproject.files.tar.gz ]; then
> rm /mnt/backup/mailbackups/*.dotproject.files.tar.gz
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
>> if [ -f /mnt/backup/mailbackups/*.dotproject.files.tar.gz ]
>> rm /mnt/backup/mailbackups/*.dotproject.files.tar.gz
>> and I keep getting the error:-
>> ./DingDong.sh: line 2: [: too many arguments
>> Please tell me how I got this wrong.
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