Re: Checking if database exists on another server
From: Kevin Collins (spamtotrash_at_toomuchfiction.com)
Date: 05/21/04
- Next message: Timo: "Re: Sorting with line's last digit"
- Previous message: Ellixis: "Re: POSIX Token recognition"
- In reply to: zanzan: "Checking if database exists on another server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 21 May 2004 16:17:04 GMT
In article <4e657c51.0405200925.566d8ad2@posting.google.com>, zanzan wrote:
> Hello,
>
> I'm writing a little script and I would like to find out if a certain
> database exists on a specific server.
>
> I tried this but it did not work :
>
> if [-x -h IpAdressOfOtherServer dbname ]; ...
And how is that supposed to do what you want? Both -x and -h take arguments,
but need something to "AND" (-a or &&, depending on shell) the tests:
if [[ -x IpAdressOfOtherServer -a -h dbname ]; ...
or
if [[ -x IpAdressOfOtherServer && -h dbname ]]; ...
Additionally, yours tests make no sense: -x tests a file to see if it is
executable and -h checks to see if it is a symbolic link, so your test is
saying:
If the file "IpAdressOfOtherServer" is executable AND the file "dbname" is a
symbolic link, do something.
Kevin
- Next message: Timo: "Re: Sorting with line's last digit"
- Previous message: Ellixis: "Re: POSIX Token recognition"
- In reply to: zanzan: "Checking if database exists on another server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|