Operating System - Linux
1753297 Members
6895 Online
108792 Solutions
New Discussion

Re: scanning the contents of a variable

 
SOLVED
Go to solution
Bryan D. Quinn
Respected Contributor

Re: scanning the contents of a variable

Thanks again everybody...it has been quite a while since I have been out here on the forums. You guys just made me realize what I have been missing.

Thanks for getting me straight Mel!
Sandman!
Honored Contributor

Re: scanning the contents of a variable

IMHO...you needs are well met by the substr function within awk. Lets say you wanted the string of characters between positions 13-20 contained in VAR:

# echo $VAR | awk '{print substr($0,13,20)}'

cheers!