Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!pacbell!ptsfa!dmt From: dmt@PacBell.COM (Dave Turner) Newsgroups: comp.unix.questions Subject: Re: slicing the date Message-ID: <4737@ptsfa.PacBell.COM> Date: 29 Mar 89 18:38:27 GMT References: <216000010@s.cs.uiuc.edu> Reply-To: dmt@PacBell.COM (Dave Turner) Organization: Pacific * Bell, San Ramon, CA Lines: 17 In article <216000010@s.cs.uiuc.edu> carroll@s.cs.uiuc.edu writes: >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 You might try: date "+%H %M %S" | read HH MM SS echo $HH echo $MM echo $SS -- Dave Turner 415/542-1299 {att,bellcore,sun,ames,pyramid}!pacbell!dmt