Good morning,

On 22/05/14 at 11:14 PM +0100, Jason Davies <[email protected]> wrote:

4) (*this is the bit I can't get to work*) The script checks whether a file already exists -- I don't want to overwrite anything that exists by mistake.

You don't say what sort of script, or if you did I missed it. But in shell and perl, the idea is the same, you are doing a 'file test'. In perl it would be something like:

if (! -e $path_var) { # does file exist
  # create file
}
## or this if perms are an issue
if (! -r $path_var) { # can I read a file
  # create file
}

There is similar syntax for shell commands.


Charlie

--
    Make-Tracks Secure Hosting Pty Ltd  <http://www.make-tracks.com>
    PO Box 141                               <[email protected]>
    Windsor NSW 2756  Australia                 Ph:  +61 2 9043 0613

    ** Take Control of Your Website **

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to