The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Retrieve the first 9 digits from the numeric value
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Retrieve the first 9 digits from the numeric value
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
06-30-2008
fpmurphy
Moderator
Join Date: Dec 2003
Location: Florida
Posts: 1,937
And another way
Code:
#!/bin/ksh93 n=000000001200820060734 n=${n/*(0)({9}(\d))*(\d)/\2} print $n
fpmurphy
View Public Profile
Visit fpmurphy's homepage!
Find all posts by fpmurphy
Find fpmurphy's past nominations received
Find fpmurphy's present nominations given