Sponsored Content
Full Discussion: If Then Else Logic
Top Forums UNIX for Dummies Questions & Answers If Then Else Logic Post 302146795 by jadionne on Thursday 22nd of November 2007 08:49:38 AM
Old 11-22-2007
Quote:
Originally Posted by LivinFree
It does appear that you're using SQL syntax in the shell Smilie

What shell do you use? What platform? (uname -a; echo $SHELL)

The syntax of `if` varies by shell and version, somewhat - here's an example that should work in bash, ksh, or POSIX shell (make sure to test it first!):
Code:
if [ $EXTRACT_ROW_COUNT > 0 -a $EXTRACT_ROW_COUNT = $LOADED_ROW_COUNT ]; then
     nohup $REFERENCE_SCRIPT"renme_ref_concern.sh" &
   else
     echo "LOAD INCOMPLETE" > $REFERENCE_LOG"CONCERN_LOAD_FAILURE.LOG"
fi

There's got to be dozens of ways to do this; this is just one way that should work in many shells.
One more question, If I am using the above code, how would I put in a second action if the test fails to terminate the script? Do I just use a ; after the log file is wrten and say end?
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Need help in logic

I have big large snapshot file which contains every process start time and end time. One server snapshot contains many Application handle. My task is to identify the process id for which the end time is not there or empty also if the completion time is not on the same date then I need to kill. ... (6 Replies)
Discussion started by: senthilkumar_ak
6 Replies
SQL::ReservedWords(3pm) 				User Contributed Perl Documentation				   SQL::ReservedWords(3pm)

NAME
SQL::ReservedWords - Reserved SQL words by ANSI/ISO SYNOPSIS
if ( SQL::ReservedWords->is_reserved( $word ) ) { print "$word is a reserved SQL word!"; } DESCRIPTION
Determine if words are reserved by ANSI/ISO SQL standard. METHODS
is_reserved( $word ) Returns a boolean indicating if $word is reserved by either "SQL:1992", "SQL:1999" or "SQL:2003". is_reserved_by_sql1992( $word ) Returns a boolean indicating if $word is reserved by "SQL:1992". is_reserved_by_sql1999( $word ) Returns a boolean indicating if $word is reserved by "SQL:1999". is_reserved_by_sql2003( $word ) Returns a boolean indicating if $word is reserved by "SQL:2003". reserved_by( $word ) Returns a list with SQL standards that reserves $word. words Returns a list with all reserved words. EXPORTS
Nothing by default. Following subroutines can be exported: is_reserved is_reserved_by_sql1992 is_reserved_by_sql1999 is_reserved_by_sql2003 reserved_by words SEE ALSO
SQL::ReservedWords::DB2 SQL::ReservedWords::MySQL SQL::ReservedWords::ODBC SQL::ReservedWords::Oracle SQL::ReservedWords::PostgreSQL SQL::ReservedWords::SQLite SQL::ReservedWords::SQLServer ISO/IEC 9075:1992 Database languages -- SQL ISO/IEC 9075-2:1999 Database languages -- SQL -- Part 2: Foundation (SQL/Foundation) ISO/IEC 9075-2:2003 Database languages -- SQL -- Part 2: Foundation (SQL/Foundation) AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-28 SQL::ReservedWords(3pm)
All times are GMT -4. The time now is 05:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy