TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:7564] more bash
On 13 Aug, Phil Mendelsohn wrote:
> So, if you get info back from a command, and want to string compare the
> first 3 characters, don't tell me I have to go do this in Perl or
> something, do you?
> 
> day=`date`
> if [ day = "Fri *" ]; then
Try this:
day=`date`
case "$day" in
  Fri*) command;;
  Sat*) command;;
esac
Note the two ;'s, you need them for the end of each match.
-- 
Jon Schewe 
http://eggplant.mtu.net/~jpschewe
schewe@tcfreenet.org
- References:
- more bash
- From: Phil Mendelsohn <mend0070@tc.umn.edu>