Sponsored Content
Full Discussion: AND OR with if
Top Forums UNIX for Dummies Questions & Answers AND OR with if Post 96811 by whugo on Tuesday 24th of January 2006 02:00:32 AM
Old 01-24-2006
AND OR with if

Hi,

I am try to set certain time parameters.
The if statement only seems to see the part before || or &&.
Please assist.
The code below.

if test `date +%a` != "Sat" || `date +%a` != "Sun"
then
day_type="weekday"
else
day_type="weekend"
fi

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

Thanks
 
NWFSTIME(1)							     nwfstime							       NWFSTIME(1)

NAME
nwfstime - Display / Set a NetWare server's date and time SYNOPSIS
nwfstime [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ] [ -s ] DESCRIPTION
nwfstime displays a NetWare server's date and time. You can also set a NetWare server's date and time from the local time. OPTIONS
-h With -h nwfstime prints a little help text. -S server is the name of the server you want to use. -U user user is the user name to use for login. To set the server's time, you need supervisor privileges. -P password password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwfstime prompts for a password. -n -n should be given if no password is required for the login. As you need supervisor privileges for setting the date and time, this option is probably not used very often. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. -s With -s, nwfstime sets the file server's date and time according to the local date and time. nwfstime 12/10/1996 NWFSTIME(1)
All times are GMT -4. The time now is 12:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy