Sponsored Content
Top Forums Shell Programming and Scripting script not working...select utility Post 302192949 by mobydick on Thursday 8th of May 2008 06:33:12 AM
Old 05-08-2008
okay i got hold of the error

[ $firstname != $myname ]

...i was missing the spaces in between


thanks everyone who cared to help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cdrdao utility script

friends, i love ya... i wrote a script to automate using cdrdao to burn an audio cd from mp3 files, using the great tutorial at http://tldp.org/HOWTO/MP3-CD-Burning/index.html (check out the site, i believe that it's very well-written). i messed around with it and got to a place where i felt... (2 Replies)
Discussion started by: snwright
2 Replies

2. Shell Programming and Scripting

sort utility in script ?

Hi friends, I want to use sort command in script. I used the following syntax in my scipt, sort -t '|' +3 tempcdrext4.cdr > temp.mocdr It give me a error " Input file specified two times." but this command work fine in the prompt without any problem. Can sombody please tell me who... (2 Replies)
Discussion started by: maheshsri
2 Replies

3. UNIX for Dummies Questions & Answers

Need help on SCRIPT(1M) utility

Hi All, I need to do a lot of manual entries at shell prompt. So to collect the logs(each command fired in that session, i use "SCRIPT(1) : make typescript of terminal session" this is kool,but the problem here is that it saves the linefeed, and backspaces along with the commands in the log... (1 Reply)
Discussion started by: amit4g
1 Replies

4. Shell Programming and Scripting

Help on how to call a utility from script

Hi, I am new to shell scripting (sh) I need a script which will call a utility & once u call it.It will ask for inputs on the screen.These inputs it needs to get or read from a txt file. for e.g #! /bin/sh while read line do echo $line done txt file will have test 01/01/2008 ... (3 Replies)
Discussion started by: innocent
3 Replies

5. Shell Programming and Scripting

Writing a Utility Script

Hi All ,, I have couple of shell scripts .. I am trying to build a Utility script which would call each script example :: ======== 1) uni.sh 2) uni2.sh 3)uni3.sh when i run the Util script it will come as a menu ,, once i press 1 it will call the first shell script and runs it ..... (10 Replies)
Discussion started by: raghav1982
10 Replies

6. Shell Programming and Scripting

select contents between two delimiters (not working if newline in encountered)

Hi, I am facing difficulties in selecting the contents between two delimiters when there is a new line occurs.. Eg: >more sample.txt abcd -- this is the first line % efgh-- this is the second line and not able to print % ijkl -- this is the 3rd line % when i search for abcd and... (8 Replies)
Discussion started by: Balaji PK
8 Replies

7. Homework & Coursework Questions

script similar to rm utility

1. The problem statement, all variables and given/known data: saferm is a replacement for the rm utility. Rather than removing files, it move files in a sub directoy called".saferm" in the user's home directory. If "~/.saferm" doesn't exist, it is automatically created. The -l options lists the ... (3 Replies)
Discussion started by: Joey12
3 Replies

8. OS X (Apple)

Using at utility on 10.8.2 not working

I am a beginner, trying to get basic background utilities like at and cron to work on mac os x. I am typing the following at the prompt: at now + 1 minute open -a textedit ^D nothing happens at the appointed time. What to change? (7 Replies)
Discussion started by: sakurashinken
7 Replies

9. Solaris

Expect utility not working for Solaris 11

iam withdrawing this thread , It was my mistake I didn't read the code properly (0 Replies)
Discussion started by: boncuk
0 Replies

10. Shell Programming and Scripting

lftp is not working.how to replace lftp with expect utility using same .cfg file.

We have lftp command inside shell file. which is intern calling .cfg file for transferring the file from one server to other. Below command to not working. lftp -e "set net:max-retries 1; set net:reconnect-interval-base 1; put -E -O /destinationdir/inbox/ /sourcedir/test.txt; bye" -u... (4 Replies)
Discussion started by: johnsnow
4 Replies
CUBRID_QUERY(3) 							 1							   CUBRID_QUERY(3)

cubrid_query - Send a CUBRID query

SYNOPSIS
resource cubrid_query (string $query, [resource $conn_identifier]) DESCRIPTION
cubrid_query(3) sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified $conn_identifier. PARAMETERS
o $query - An SQL query Data inside the query should be properly escaped. o $conn_identifier - The CUBRID connection. If the connection identifier is not specified, the last connection opened by cubrid_connect(3) is assumed. RETURN VALUES
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, cubrid_query(3) returns a resource on success, or FALSE on error. For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, cubrid_query(3) returns TRUE on success or FALSE on error. The returned result resource should be passed to cubrid_fetch_array(3), and other functions for dealing with result tables, to access the returned data. Use cubrid_num_rows(3) to find out how many rows were returned for a SELECT statement or cubrid_affected_rows(3) to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement. cubrid_query(3) will also fail and return FALSE if the user does not have permission to access the table(s) referenced by the query. EXAMPLES
Example #1 Invalid Query The following query is syntactically invalid, so cubrid_query(3) fails and returns FALSE. <?php $conn = cubrid_connect('localhost', 33000, 'demodb'); $result = cubrid_query('SELECT * WHERE 1=1'); if (!$result) { die('Invalid query: ' . cubrid_error()); } ?> Example #2 Valid Query The following query is valid, so cubrid_query(3) returns a resource. <?php // This could be supplied by a user, for example $firstname = 'fred'; $lastname = 'fox'; $conn = cubrid_connect('localhost', 33000, 'demodb'); cubrid_execute($conn,"DROP TABLE if exists friends"); cubrid_execute($conn,"create table friends(firstname varchar,lastname varchar,address char(24),age int)"); cubrid_execute($conn,"insert into friends values('fred','fox','home-1','20')"); cubrid_execute($conn,"insert into friends values('blue','cat','home-2','21')"); // Formulate Query // This is the best way to perform an SQL query // For more examples, see cubrid_real_escape_string() $query = sprintf("SELECT firstname, lastname, address, age FROM friends WHERE firstname='%s' AND lastname='%s'", cubrid_real_escape_string($firstname), cubrid_real_escape_string($lastname)); // Perform Query $result = cubrid_query($query); // Check result // This shows the actual query sent to CUBRID, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . cubrid_error() . " "; $message .= 'Whole query: ' . $query; die($message); } // Use result // Attempting to print $result won't allow access to information in the resource // One of the cubrid result functions must be used // See also cubrid_result(), cubrid_fetch_array(), cubrid_fetch_row(), etc. while ($row = cubrid_fetch_assoc($result)) { echo $row['firstname']; echo $row['lastname']; echo $row['address']; echo $row['age']; } // Free the resources associated with the result set // This is done automatically at the end of the script cubrid_free_result($result); ?> SEE ALSO
cubrid_connect(3), cubrid_error(3), cubrid_real_escape_string(3), cubrid_result(3), cubrid_fetch_assoc(3), cubrid_unbuffered_query(3). PHP Documentation Group CUBRID_QUERY(3)
All times are GMT -4. The time now is 12:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy