Jump to content
Калькуляторы

Обработка тел.номера в TCL-скрипте

Коллеги, приветствую!

 

Пытаюсь написать tcl скрипт для обработки звонков на Cisco и столкнулся с дурацкой проблемой.

Дано: ANI вида "74957777777", надо получить из него "7777777", т.е. оставить последние n-знаков, а остальное отрезать.

Ситуация осложняется тем что ANI может быть вида "4957777777" или "+74957777777", т.е. предугадать кол-во символов сложно.

 

Есть идеи как чистить ANI элегантнее?

Share this post


Link to post
Share on other sites

lumenok Неверно, оно у вас только +7 отрежет, ТС нужно чтото вроде

echo "+74957777777" | sed 's/^.*\(.......\)$/\1/'

где n - число точек.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.