slicing the date

Dave Turner dmt at PacBell.COM
Thu Mar 30 04:38:27 AEST 1989


In article <216000010 at s.cs.uiuc.edu> carroll at 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



More information about the Comp.unix.questions mailing list