Sponsored Content
Full Discussion: If Then Else Logic
Top Forums UNIX for Dummies Questions & Answers If Then Else Logic Post 302146771 by jadionne on Thursday 22nd of November 2007 07:04:53 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.

To answer your question:
Code:
$ $ uname -a
SunOS scrbtpcdkbry211 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V490
$ echo $SHELL
/bin/ksh

Do you know of a good web page that discribes the switches to your command well? I beleve that is what is confusing me the most.
 

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
suspend(1)                                                         User Commands                                                        suspend(1)

NAME
suspend - shell built-in function to halt the current shell SYNOPSIS
sh suspend csh suspend ksh suspend DESCRIPTION
sh Stops the execution of the current shell (but not if it is the login shell). csh Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su. ksh Stops the execution of the current shell (but not if it is the login shell). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5) SunOS 5.10 15 Apr 1994 suspend(1)
All times are GMT -4. The time now is 01:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy