Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 157

replace space with underscore in expect script

$
0
0
#!/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.


Viewing all articles
Browse latest Browse all 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>