The + sign used here isn't anything special to the shell it's just a char we have thrown inbetween the two variables. One could just as well use "_" or "," as long as the character isn't in the strings being tested.
What is happening is the two strings are joined together and then the glob pattern matching capabilites of the case statement are used to match what is required.
So for upper or lower case and using "_" we would have:
The expression "*_[Mm]|[Mm]_*" equates to:
Some example strings that will match this are:
Last edited by Chubler_XL; 03-15-2011 at 01:26 PM..
Hi,
I am trying to use && set up to match two conditions within ksh:
if &&
then
'''Do something
if
somehow, I keep getting error message telling me that ] is missing.
What's wrong with my code?
Thanks a lot for your help! (1 Reply)
I have a script that runs on multiple servers. What I want to do is have the script do the following:
if $(hostname) is equal to server or server2
then
TO_DIR=go
else
TO_DIR=stop
fi
I have tried:
if
if ]
Server is hpux.
any ideas? (1 Reply)
echo "please enter ur choice..
1. Make a file.
2. Display contents
3. Copy the file
4. Rename the file
5. Delete the file
6. Exit"
read choice
case $choice in
1 ) echo enter the file name
read fname
if
then
echo... (2 Replies)
Hello,
I'm trying to put together a script that involves pulling data from a config file. I'm attempting to write an if statement to validate one of the pieces of data from the config file, but I think I'm fat fingering it somehow.
$config{VALUE} is being pulled from a config file but can only... (4 Replies)
When I try the below if Condition with single condition its working fine.
But when I try to Club both its working . But giving wrong results.
In my case
cond1 = -f ${filename1} = true
cond2 = -f ${filename2} = true
But Cond1 & Cond2 is resulting in False ??? Please advise
... (5 Replies)
Hi all,
I am attempting to create a shell script to optimize some routine process.
I want this script can let user select the actions they want to do.
But I met a problem that my script can only read one input and then do one action.
Is it possible to let my script to run more than one... (2 Replies)
Hello,
I am using shell scripting and I am recieving odd results from my if statement
if
I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
I was trying to write multiple conditions inside the if statement but its not working.
export VAR_NM=abc.txt
export CURR_DT=20131011
export PREV_DT=20131012
if &&
then
echo "Yes"
else
echo "NO"
fi
It should return Yes but returning NO always.Appreciate any help. (3 Replies)
I wish to check two conditions inside the if statement
Condition 1: The two file contents should be identical // using cmp command for this.
Condition 2: The two filenames should NOT be the same.
This is what i did in vain.
if ]; then
where entry1 and entry2 are
ls *.txt | while... (7 Replies)
Discussion started by: mohtashims
7 Replies
LEARN ABOUT PHP
sqlsrv_free_stmt
SQLSRV_FREE_STMT(3)SQLSRV_FREE_STMT(3)sqlsrv_free_stmt - Frees all resources for the specified statementSYNOPSIS
bool sqlsrv_free_stmt (resource $stmt)
DESCRIPTION
Frees all resources for the specified statement. The statement cannot be used after sqlsrv_free_stmt(3) has been called on it. If sql-
srv_free_stmt(3) is called on an in-progress statement that alters server state, statement execution is terminated and the statement is
rolled back.
PARAMETERS
o $stmt
- The statment for which resources are freed. Note that NULL is a valid parameter value. This allows the function to be called
multiple times in a script.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
sqlsrv_free_stmt(3) example
<?php
$serverName = "serverNamesqlexpress";
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$stmt = sqlsrv_query( $conn, "SELECT * FROM Table_1");
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
/*-------------------------------
Process query results here.
-------------------------------*/
/* Free the statement resources. */
sqlsrv_free_stmt( $stmt);
?>
NOTES
The main difference between sqlsrv_free_stmt(3) and sqlsrv_cancel(3) is that a statement resource cancelled with sqlsrv_cancel(3) can be
re-executed if it was created with sqlsrv_prepare(3). A statement resource cancelled with sqlsrv_free_statement(3) cannot be re-executed.
SEE ALSO sqlsrv_cancel(3).
PHP Documentation Group SQLSRV_FREE_STMT(3)