Oct 4, 2004 #1 jouell MIS Nov 19, 2002 304 US Hi, Does ksh allow me to return "Sep" if my variable is September (I am not using the date command in the script) ? I.E. month=September echo $month{1-3} or something? Didnt find it in man for ksh. tks! -john
Hi, Does ksh allow me to return "Sep" if my variable is September (I am not using the date command in the script) ? I.E. month=September echo $month{1-3} or something? Didnt find it in man for ksh. tks! -john
Oct 4, 2004 2 #2 PHV MIS Nov 8, 2002 53,708 FR Something like this ? typeset -L3 y=$month;echo $y Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Something like this ? typeset -L3 y=$month;echo $y Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Oct 4, 2004 #3 vgersh99 Programmer Jul 27, 2000 2,146 US Code: #!/bin/ksh echo "${month%${month#???}}" vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
Code: #!/bin/ksh echo "${month%${month#???}}" vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Oct 4, 2004 #4 PHV MIS Nov 8, 2002 53,708 FR Yet another way: expr substr $month 1 3 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Yet another way: expr substr $month 1 3 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Oct 4, 2004 Thread starter #5 jouell MIS Nov 19, 2002 304 US Thanks for the fast responses!!! That is the ticket! -john Upvote 0 Downvote
Oct 8, 2004 #6 imayankee Technical User Oct 6, 2004 3 US Using ksh93: # month=September # print $month September # print ${month:0:3} Sep Upvote 0 Downvote