Sponsored Content
Full Discussion: AND OR with if
Top Forums UNIX for Dummies Questions & Answers AND OR with if Post 96813 by Ygor on Tuesday 24th of January 2006 02:36:04 AM
Old 01-24-2006
You don't say which shell you are using, but from the syntax I would guess you are using the original bourne shell.

You should use && for the first condition and you need an additional "test" after &&.
Code:
if test `date +%a` != "Sat" && test `date +%a` != "Sun"
then
    day_type="weekday"
else 
    day_type="weekend"
fi

if test `date +%H%M` -gt 600 && test `date +%H%M` -lt 2000
then
    time="workhours"
else
    time="afterhours"
fi

 
test-speech(1)							   User Commands						    test-speech(1)

NAME
test-speech - a test application provided by gnome-speech DESCRIPTION
test-speech is a simple test application provided by gnome-speech. It is used to verify the driver for a speech engine, e.g., freetts-syn- thesis-driver, is funcioning properly, in order to make sure users can activate and interact with the gnome-speech driver successfully. GNOME Speech aims to be a general interface to various text-to-speech engines for the GNOME desktop. It allows the simple speaking of text, as well as control over various speech parameters such as speech pitch, rate, and volume. FILES
The following files are used by this application: /usr/bin/test-speech a test application provided by gnome-speech ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-a11y-speech | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
libgnomespeech(3), attributes(5) NOTES
gnome-speech is written by Marc Mulcahy and Michael Meeks. SunOS 5.11 3 Dec 2006 test-speech(1)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy