Sponsored Content
Full Discussion: Check variable
Top Forums Shell Programming and Scripting Check variable Post 302853577 by JPad on Sunday 15th of September 2013 11:01:30 AM
Old 09-15-2013
when i try it, then i got this

Code:
./startscript.sh mainstall
./startscript.sh: 76: [: missing ]
./startscript.sh: 80: cd: can't cd to TYPE_YOUR_PATH
ManiaPlanetServer is downloading.
No passwordentrie for user »TYPE_YOUR_USERNAME«

ManiaPlanetServer is downloaded.

unzip ManiaPlanet
No passwordentrie for user »TYPE_YOUR_USERNAME«
ManiaPlanet was unpacked
ManiaPlanet is given the correct rights.
chmod: access to „ManiaPlanetServer“ not possible: file or directory not found

Ready
Please rename /UserData/Config/dedicated_cfg.default.txt in dedicated_cfg.txt and edit the renamed file.
Push the Startbutton to start ManiaPlanet.

here my code

Code:
mainstall)
    if [ "$USER" = "TYPE_YOUR_USERNAME" ] && [ "$SERVER" = "TYPE_YOUR_SCREENAME_MANIAPLANET" ] && [ "$TITLE" = "TYPE_YOUR_TITLE" ] && [ "$PF" = "TYPE_YOUR_PATH" ] && [ "$MAPLIST" = "TYPE_YOUR_MATCHSETTINGS"]; then
    echo "Please edit the config section!!!!"
    exit 1
    else
    cd $PF
    echo "ManiaPlanetServer is downloading."
    su $USER -c "wget http://files.maniaplanet.com/ManiaPlanet2Beta/ManiaPlanetBetaServer_latest.zip"
    echo ""
        sleep 5
        echo "ManiaPlanetServer is downloaded."
        echo ""
        echo "unzip ManiaPlanet"
        su $USER -c "unzip ManiaPlanetBetaServer_latest.zip"
        sleep 5
        echo "ManiaPlanet was unpacked"
        echo "ManiaPlanet is given the correct rights."
        chmod +x ManiaPlanetServer
        echo ""
        echo "Ready"
        echo "Please rename /UserData/Config/dedicated_cfg.default.txt in dedicated_cfg.txt and edit the renamed file."
        echo "Push the Startbutton to start ManiaPlanet."
    fi

;;

greetz JPad
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Check if variable is a number

If I have a variable $X, how do I check it is a number? Many thanks. (2 Replies)
Discussion started by: handak9
2 Replies

2. Shell Programming and Scripting

check for NULL variable

Hello I want to check for NULL variable.. but this is not working..please help thanks in advance esham (2 Replies)
Discussion started by: esham
2 Replies

3. Shell Programming and Scripting

How to check parameter variable?

Hello All, I have a script that will email out if the email address is specified as parameter 1. I am using ksh, and then tried the following : email=$1 Following did not work, I am getting error test -z $email test ${email:=" ") -eq " " test -n $email test ${?email} What... (4 Replies)
Discussion started by: negixx
4 Replies

4. Shell Programming and Scripting

How to check if a variable contains a .

Hi I am writing a bash script and would like to check is a variable contains a . or not ex. a=102 output ok a=1.02 output not ok Many thanks, (3 Replies)
Discussion started by: gekkos
3 Replies

5. Shell Programming and Scripting

check if a variable is not affected

Hi all, to check that a variable is not empty, I usually do: if ; then... or if ; then... what if I have a serie of variables and want to do the same test on all of them. How to do this in a single if statement? thank you (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

6. UNIX for Dummies Questions & Answers

Check the value of a string variable

hi to all, i want to check the value of a variable that it contains characters. for example i try the following: if then ......... i just want to check that in the specific line that is a variable called "passline" has the entry "password". But it can contain also other characters in the... (4 Replies)
Discussion started by: omonoiatis9
4 Replies

7. Shell Programming and Scripting

Check if a variable is zero

I have seen many posts for this sort of problem but I just did not know how to use it for my issue. A number is assigned to a variable and I wanted to check if it is a zero or non zero. Example of my numbers are below: 000000000000000000000000000000000000000000000000... (8 Replies)
Discussion started by: soujiv
8 Replies

8. Shell Programming and Scripting

Check the value of a variable

#!/bin/sh echo "Running Script to capture ORACLE Erros" # Change Directory to the actual logs path cd /home/nv8510/lognew err_var=`grep -in "ORA-" *` if then echo "THESE ARE THE ORACLE ERROR OCCURED" echo "$err_var" echo... (7 Replies)
Discussion started by: neeraj617
7 Replies

9. Shell Programming and Scripting

Check if a variable is having value

I have a script /root/asas with following contents. #!/bin/bash ha=`cat /etc/passwd | grep sandra` if ; then echo "Sandra is in /etc/passwd" echo "variable ha is $ha" else echo "Sandra is NOT in /etc/passwd" echo "variable ha is $ha" fi What... (3 Replies)
Discussion started by: anil510
3 Replies

10. Shell Programming and Scripting

How to check whether a variable is empty or contains some value?

hi, i want to check whether a a variable contains some value or is empty in a shell script. so if the variable contains some value i want to do some job and if the variable doesnt contain any value then i need to skip that job. here is a sample script read_filenames.sh contains ... (5 Replies)
Discussion started by: Little
5 Replies
MSSQL_FIELD_SEEK(3)													       MSSQL_FIELD_SEEK(3)

mssql_field_seek - Seeks to the specified field offset

SYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset) DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned. PARAMETERS
o $result - The result resource that is being evaluated. This result comes from a call to mssql_query(3). o $field_offset - The field offset, starts at 0. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Using mssql_field_seek(3) on the example for mssql_fetch_field(3) <?php // Connect to MSSQL and select the database mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi'); mssql_select_db('php'); // Send a select query to MSSQL $query = mssql_query('SELECT * FROM [php].[dbo].[persons]'); // Construct table echo '<h3>Table structure for 'persons'</h3>'; echo '<table border="1">'; // Table header echo '<thead>'; echo '<tr>'; echo '<td>Field name</td>'; echo '<td>Data type</td>'; echo '<td>Max length</td>'; echo '</tr>'; echo '</thead>'; // Dump all fields echo '<tbody>'; for ($i = 0; $i < mssql_num_fields($query); ++$i) { // Fetch the field information, notice the // field_offset parameter is not set. See // the mssql_field_seek call below $field = mssql_fetch_field($query); // Print the row echo '<tr>'; echo '<td>' . $field->name . '</td>'; echo '<td>' . strtoupper($field->type) . '</td>'; echo '<td>' . $field->max_length . '</td>'; echo '</tr>'; // Move the internal seek pointer to the next // row in the result set mssql_field_seek($query, $i + 1); } echo '</tbody>'; echo '</table>'; // Free the query result mssql_free_result($query); ?> SEE ALSO
mssql_fetch_field(3). PHP Documentation Group MSSQL_FIELD_SEEK(3)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy