[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with a bash script please



On 14.01.2011 10:33, Adrian Levi wrote:
I have the following bash script and it fails at line 14 and 15
(7zparameters= and 7zfilename=) I have tried everything i can think of
to get it to work, the answer has to be simple but i can't figure it.

This is going to be my new backup script, based on an earlier version
that is very similar in functionality except I wasn't using tar, in
that version.

#!/bin/sh
[...]

others already pointed out your syntactical errors, but there's one thing i want to add:

in debian lenny (and previous releases) the default shell aka sh is bash. the file /bin/sh is a symbolic link to /bin/bash.
however in squeeze afaik the default shell is dash.
so your script starting with the shebang #!/bin/sh will not be run from bash. to ensure you want it to be executed by bash (if you don't start it with 'bash filename') put the shebang line as #!/bin/bash (#!/bin/bash -x to debug).

best regards

mart


Reply to: