Sponsored Content
Full Discussion: If condition not working
Top Forums Shell Programming and Scripting If condition not working Post 302137678 by mnidugala on Wednesday 26th of September 2007 09:37:48 AM
Old 09-26-2007
May be this will help you

Hope the following will help you.

if [[ "$ftime" > "01:00"&&"$ftime" < "05:00" ]]; then
echo "$ftime"
fi
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

wild card in if condition not working

Hi, I am using RHEL5. I have following if condition. if In the above condition, if the value of a contains word WARNING, it should match. i.e., WARNING_MESSAGE, CRITICAL WARNING, WARNING ALERT etc. it should match. For b, alert error, ALERT ERROR, ERROR IMMEDIATE ACTION REQUIRED, etc... (2 Replies)
Discussion started by: user7509
2 Replies

2. UNIX for Advanced & Expert Users

If condition and htm not working

checkSync() { CONNECT_STRING=TLDB61/TLDB61@TL10G SQLPLUS_SETTINGS="SET PAGESIZE 0 LINESIZE 1500 ECHO OFF TRIMS ON TAB OFF FEEDBACK OFF HEADING OFF" SQL_RESULT_SYNC_PMCM=`sqlplus -s ${CONNECT_STRING} << EOF ${SQLPLUS_SETTINGS} (SELECT... (2 Replies)
Discussion started by: madfox
2 Replies

3. Shell Programming and Scripting

Using ssh to transfer file not working inside if-condition

Hi all, ssh uname@remote_server 'cat /tmp/remote_file_name > home_dir/a512386/new/local_file_name' The above given command is working fine. but if i try to move the file only if exists in the remote server i.e) giving the same within if condition it executes but the file is not stored in my... (1 Reply)
Discussion started by: Shri123
1 Replies

4. HP-UX

Difference between [condition] and [[condition]] and ((condition)) when used with if condition

Executed the following if conditions .. and got different results . only (( )) gave correct o/p with all scenarios . Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition. And why each condition gave different result. 1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies

5. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

6. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

7. Shell Programming and Scripting

Automating pbrun /bin/su not working, whenever manually it is working using putty

I am trying to automate a script where I need to use pbrun /bin/su but for some reason it is not passing thru the pbrun as my code below. . ~/.bash_profile pbrun /bin/su - content c h 1 hpsvn up file path I am executing this from an external .sh file that is pointing to this scripts file... (14 Replies)
Discussion started by: jorgejac
14 Replies

8. UNIX for Beginners Questions & Answers

If condition is not working and getting error

Hi Team, If condition is not working properly and getting below error # ./score1.sh Enter your score ('q' for quit): 102 Enter your score ('q' for quit): q ./score1.sh: line 9: q: integer expression expected Average is: 102%. Exit. Actual code # Calculate the average of given... (3 Replies)
Discussion started by: Torrid
3 Replies

9. Shell Programming and Scripting

Disk Space Utilization in HTML format working in one environment and not working on the other

Hi Team, I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system. df -h | awk -v host=`hostname` ' BEGIN { print "<table border="4"... (13 Replies)
Discussion started by: Harihsun
13 Replies

10. Shell Programming and Scripting

If condition on shell not working , not sure what is the mistake I am doing?

I have a requirement to perform specific set of tasks based on server , So I want to have the condition(s) defined based on server. Here is the script I came up with and I have read multiple blogs and couldn`t find any mistake from my script. Can you guide on what I am overlooking here ? ... (2 Replies)
Discussion started by: Varja
2 Replies
FTIME(3)						   BSD Library Functions Manual 						  FTIME(3)

NAME
ftime -- get date and time SYNOPSIS
#include <sys/timeb.h> int ftime(struct timeb *tp); DESCRIPTION
This interface is obsoleted by gettimeofday(2). The ftime() routine fills in a structure pointed to by its argument, as defined by <sys/timeb.h>: /* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; The structure contains the time since the epoch, in seconds; up to 1000 milliseconds of more-precise interval; the local time zone (measured in minutes of time westward from Greenwich); and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. LEGACY SYNOPSIS
#include <sys/types.h> #include <sys/timeb.h> The include file <sys/types.h> is necessary. SEE ALSO
gettimeofday(2), settimeofday(2), ctime(3), time(3), compat(5) HISTORY
The ftime function appeared in 4.2BSD. BSD
June 4, 1993 BSD
All times are GMT -4. The time now is 08:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy