Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 02-01-2003, 07:22 PM   #1
Member (6 bit)
 
Join Date: Nov 2001
Posts: 57
Want to do a substr in Korn shell

Hello, I am maintaining a korn shell in which I just want to substr a variable to extract year 92 from hosp. Shell doesn't seem to have substr function so I was looking for awk substr function but, awk requires an input file or command keyboard input !

my korn shell coding looks like these, I am stuck at the awk statement :

#!/bin/ksh
sasname=hosp92
echo $sasname
year=awk '{substr($sasname,4,2)}'
echo $year
qa_core=qa_core${year}
logargs='-log ../log/${qa_core}.log -print'
echo $logargs
jchoy is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2