slicing the date

carroll at s.cs.uiuc.edu carroll at s.cs.uiuc.edu
Tue Mar 28 07:34:00 AEST 1989


Allright, I can't figure this out. I'm trying to put the current system
time in my prompt. Under SysV, I can use 'cut' to pick out the seperate
hours, minutes, and seconds from 'date'. For non-SysV types, 'cut' lets
you pick out fields using either delimiter characters or absolute column
counts. I found a way to do this using Ksh (with the pattern matchers),
but it is very ugly. The question is, how can I cut up the output of
date to put the hours, minutes, and seconds into seperate variables? Thanks!

Alan M. Carroll          "And then you say,
carroll at s.cs.uiuc.edu     We have the Moon, so now the Stars..."  - YES
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll



More information about the Comp.unix.questions mailing list