#!/usr/bin/expect -fset cmd "abc def ghi lkj"set log [ expr echo ${cmd// /_} ]
I would like to log variable as ghi_lkj
first I wast trying to replace all spaces with underscores and then remove first two words.
I want to do it only in expect script not shell script.
please suggest how to do. Thanks in Advance.