05-01-2006 06:34 PM
How do i extract certain characters from a string stored in a $variable?
set text = "01L"
i want to extract and store "01" only into another $variable. Thanks!
Solved! Go to Solution.
05-01-2006 07:14 PM
Perhaps these links will help.
Owner of ISN Corporation
05-01-2006 11:41 PM
I'm glad you found a solution.
However, it involves a fork of a utility where it seems that a native shell command can do the trick.
For onesies-twosies it does not matter, for commands executed in a tight loop it can make a critical difference in execution performance.
The shell has several editing operations.
In your case i woudl consider 'tail end pattern deletion'
# echo $other
from "man ksh"
If the shell pattern matches the end of the value of parameter, the value of parameter with the matched part is deleted; otherwise substitute the value of parameter. In the former, the smallest matching pattern is deleted; in the latter, the largest matching pattern is deleted.