Summary: char2number() in Shell

From: Carl Ma <carl_ma_at_scotiacapital.com>
Date: Fri May 09 2003 - 18:05:06 EDT
Thanks for the quick replies from Matthew Stier and Florendo Jay.

date +%w 

does the trick.


thanks again!

carl
:Date: Fri, 09 May 2003 17:29:51 -0400 (EDT)
:From: Carl Ma <carl_ma@scotiacapital.com>
:Subject: char2number() in Shell
:To: sunmanagers@sunmanagers.org
:MIME-version: 1.0
:Content-MD5: i0DSBRV5FRZ6TQJTsGVx+w==
:X-BeenThere: sunmanagers@sunmanagers.org
:Delivered-to: sunmanagers@sunmanagers.org
:X-Original-To: sunmanagers@sunmanagers.org
:X-MailScanner-Information: 
:X-Mailman-Version: 2.1.2
:List-Post: <mailto:sunmanagers@sunmanagers.org>
:List-Subscribe: <http://www.sunmanagers.org/mailman/listinfo/sunmanagers>, 
<mailto:sunmanagers-request@sunmanagers.org?subject=subscribe>
:List-Unsubscribe: <http://www.sunmanagers.org/mailman/listinfo/sunmanagers>, 
<mailto:sunmanagers-request@sunmanagers.org?subject=unsubscribe>
:List-Archive: <http://sunportal.sunmanagers.org/pipermail/sunmanagers>
:List-Help: <mailto:sunmanagers-request@sunmanagers.org?subject=help>
:List-Id: The Sun Managers Mailing List  <sunmanagers.sunmanagers.org>
:
:Hello,
:
:I am using the case to convert Monday,Tuesday..Friday to number 1,2,3,4,5 like:
:
:A=date +%a
:B=0
:
:case "$A" in
:
:Mon) B=1;;
:Tue) B=2;;
:Wed) B=3;;
:Thu) B=4;;
:Fri) B=5;;
:*) echo "can only run during Mon - Fri"
:
:esac
:
:Is there built-in functions in shell,which can make the script neat?
:
:thanks & have a good weekend,
:
:carl
:_______________________________________________
:sunmanagers mailing list
:sunmanagers@sunmanagers.org
:http://www.sunmanagers.org/mailman/listinfo/sunmanagers

             \\\___/// 
            \\  - -  //
             (  @ @  )
 +---------oOOo-(_)-oOOo-------------+
 |          /_/_/    /_/_/_/_/_/     | 
 |         _/_/        _/_/          |
 |        _/_/        _/_/           |
 |       _/_/        _/_/            |
 |      /_/_/       /_/_/            |
 |    Carl E. Ma - (416)513-3149     |
 |     carl_ma@scotiacapital.com     | 
 +------------------Oooo-------------+
            oooO   (   )
           (   )    ) /
            \ (    (_/
             \_)
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri May 9 18:04:59 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:10 EST