Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'd like extract information from a string that is anything after ".".
for example, if I have:-c/rs/rs36/tap/config.76
I'd like to extract the info after "." which is "76" in this case.
any help would be appreciated

There are any number of ways. Here are two:
#!/bin/ksh
string="-c/rs/rs36/tap/config.76"
# 1
v=$(echo "$string"|awk ' BEGIN { FS="." } { print $2 } ')
echo $v# 2
set - $(IFS="."; echo $string)
echo $2

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |