[ubuntu-za] Script error
1.sean.riley
1.sean.riley at gmail.com
Tue Apr 14 13:39:34 BST 2009
Alf Stockton wrote:
> 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.
>>>
>>>
>>>
>
>
>
Please excuse the idiot... (me).... see Jonathan's explanation of what
the problem really is...
Back to Lurking for AcidHawk
cheers
More information about the ubuntu-za
mailing list