Sponsored Content
Top Forums Shell Programming and Scripting How to test whether a move command has been well executed Post 302104367 by anbu23 on Thursday 25th of January 2007 01:37:29 AM
Old 01-25-2007
Code:
mv -f $XXTEST_TOP/install/SPE1/XXTEST_SPE1_XX_QUOTE_DETAILS_TBL.sql $XXTEST_TOP/admin2/sql
if [ $? -eq 0 ]
then
    echo "Move is successful"
fi

 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Help Required: Command to find IP address and command executed of a user

Hi, I am trying to write a script which would figure out who has run which command and their IP. As i dont have any clue as to which commands would do this job, i request some gurus to help me on this. Thanks Vishwas (2 Replies)
Discussion started by: loggedout
2 Replies

2. Windows & DOS: Issues & Discussions

OpenSSH command not executed

OpenSSH does not execute commands when they are issued from the command line. I connect from a Win PC to a Win server (2003), using openssh. If I type the name of the bat file from the prompt, it starts. But when I add the command to the ssh command it does not work: ssh -vvv -i "keyname.key"... (4 Replies)
Discussion started by: DocBrewer
4 Replies

3. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

4. Shell Programming and Scripting

How command is executed

as i have been new to unix can any one can tell,when be type a command on unix shell what processing it goes through before execution of it (1 Reply)
Discussion started by: shashank1311
1 Replies

5. Shell Programming and Scripting

System Command dies even when command gets executed successfully

Hi I have created a perl script & running it using Linux machine. I want my script to die when system command is unsuccessful but script is dying even when system command gets executed successfully. :wall: I am using the command below :- system($cmd) || die "FAILED $!"; print "Hello"; ... (2 Replies)
Discussion started by: Priyanka Gupta
2 Replies

6. AIX

Script not getting executed via cron but executes when executed manually.

Hi Script not getting executed via cron but executes successfully when executed manually. Please assist cbspsap01(appuser) /app/scripts > cat restart.sh #!/bin/ksh cd /app/bin date >>logfile.out echo "Restart has been started....." >>logfile.out date >>logfile.out initfnsw -y restart... (3 Replies)
Discussion started by: samsungsamsung
3 Replies

7. Shell Programming and Scripting

Command is executed twice

Hi I try to run a command using bash script. The script should now look like this: #!/bin/bash case "$1" in start) sudo su - cispmgm -c "/usr/local/jdk/bin/java -Dworking.dir=/opt/ibm/cisp -Denvironment.target= -Xms512M -Xmx1024M -classpath... (1 Reply)
Discussion started by: nikolai.straess
1 Replies

8. Shell Programming and Scripting

Command is executed twice

Hi I try to run a command using bash script. The script should now look like this: #!/bin/bash case "$1" in start) sudo su - cispmgm -c "/usr/local/jdk/bin/java -Dworking.dir=/opt/ibm/cisp -Denvironment.target= -Xms512M -Xmx1024M -classpath... (3 Replies)
Discussion started by: nikolai.straess
3 Replies

9. Shell Programming and Scripting

Need to echo command successful if command is executed successfully

Hello, I have written a command n shell script : srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f If the above command executes successfully without error I need to echo "Service relocated successfully and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

10. UNIX for Dummies Questions & Answers

Set Command to output a log of every command executed in the script

Hi Guys, I like to output every command executed in the script to a file. I have tried set -x which does the same. But it is not giving the logs of the child script which is being called from my script. Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies
SQLSRV_NUM_FIELDS(3)													      SQLSRV_NUM_FIELDS(3)

sqlsrv_num_fields - Retrieves the number of fields (columns) on a statement

SYNOPSIS
mixed sqlsrv_num_fields (resource $stmt) DESCRIPTION
Retrieves the number of fields (columns) on a statement. PARAMETERS
o $stmt - The statment for which the number of fields is returned. sqlsrv_num_fields(3) can be called on a statement before or after statement execution. RETURN VALUES
Returns the number of fields on success. Returns FALSE otherwise. EXAMPLES
Example #1 sqlsrv_num_fields(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)); } $sql = "SELECT * FROM Table_1"; $stmt = sqlsrv_query($conn, $sql); if( $stmt === false) { die( print_r( sqlsrv_errors(), true)); } $numFields = sqlsrv_num_fields( $stmt ); while( sqlsrv_fetch( $stmt )) { // Iterate through the fields of each row. for($i = 0; $i < $numFields; $i++) { { echo sqlsrv_get_field($stmt, $i)." "; } echo "<br />"; } ?> SEE ALSO
sqlsrv_field_metadata(3), sqlsrv_fetch(3), sqlsrv_get_field(3). PHP Documentation Group SQLSRV_NUM_FIELDS(3)
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy