Saturday, July 23, 2005

The set command

#!/bin/sh
set `date`
echo "Time: $4 $5"
echo "Day: $1"
echo "Date: $3 $2 $6"


Returns:
Time: 01:33:02 EEST
Day: Sat
Date: 24 Jul 2005


The set command captures the positional parameters of `date` which has the format:


Sat Jul 24 01:33:02 EEST 2005

0 Comments:

Post a Comment

<< Home