Subject: reading date in csh script, text to numbers
To: None <netbsd-help@netbsd.org>
From: john <jkaufman@home.com>
List: netbsd-help
Date: 01/22/2001 23:15:57
This is a multi-part message in MIME format.
------=_NextPart_000_000C_01C084C9.46CCE560
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi All:
I am new to netBSD, and unix in general. My
question is about the csh. I have tried to set
date in a variable.
set month =3D date '+%m'
echo $month
When I do this, I get a syntax error. How do I
make this assignment. Also, is there a way to
convert text to a numeric value directly from=20
one or more of the shell commands, or is the
only way to do it by writing a c program?
Thanks
John ;>
------=_NextPart_000_000C_01C084C9.46CCE560
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi All:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I am new to netBSD, and unix in =
general.=20
My</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>question is about the csh. I have tried =
to=20
set</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>date in a variable.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>set month =3D date =
'+%m'</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>echo $month</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>When I do this, I get a syntax error. =
How do=20
I</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>make this assignment. Also, is there a =
way=20
to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>convert text to a numeric value =
directly from=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>one or more of the shell commands, or =
is=20
the</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>only way to do it by writing a c=20
program?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>John ;></FONT></DIV></BODY></HTML>
------=_NextPart_000_000C_01C084C9.46CCE560--