Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!s.cs.uiuc.edu!noe From: noe@s.cs.uiuc.edu Newsgroups: comp.unix.questions Subject: Re: slicing the date Message-ID: <216000012@s.cs.uiuc.edu> Date: 29 Mar 89 23:01:00 GMT References: <216000010@s.cs.uiuc.edu> Lines: 9 Nf-ID: #R:s.cs.uiuc.edu:216000010:s.cs.uiuc.edu:216000012:000:451 Nf-From: s.cs.uiuc.edu!noe Mar 29 17:01:00 1989 Maybe expr will work? Again, it's going to look sort of hideous, but it should work. For example, if date produces "Wed Mar 29 16:57:30 1989" then NOW=`date` PS1=`expr "$NOW" : '... ... \(..\)'` would set PS1=29, the day of the month. This is Bourne shell, by the way, and would also work in Kourne shell (-: but not C-shell. I assume anyone forcibly removed from a System V environment at least has the good sense to avoid csh like the plague.