| |
You are here: Experts > Computing/Technology > Focus on Unix > Unix/Linux OS > edit stuff
Expert: Denis Mello - 10/29/2009
Question Hi Denis,
there exist a script looks like this
expect {
-re ".*X.*" {send "A-specific
";sleep 1}
-re ".*X2.*" {send "A-specific
";sleep 1}
}
expect {
-re ".*X.*" {send "B-specific
";sleep 1}
-re ".*X2.*" {send "B-specific
";sleep 1}
}
expect {
-re ".*X.*" {send "C-specific
";sleep 1}
-re ".*X2.*" {send "C-specific
";sleep 1}
}
expect {
-re ".*X.*" {send "D-specific
";sleep 1}
-re ".*X2.*" {send "D-specific
";sleep 1}
}
If I would like to remove ONLY the snip below
expect {
-re ".*X.*" {send "C-specific
";sleep 1}
-re ".*X2.*" {send "C-specific
";sleep 1}
}
I need the output to be this
expect {
-re ".*X.*" {send "A-specific
";sleep 1}
-re ".*X2.*" {send "A-specific
";sleep 1}
}
expect {
-re ".*X.*" {send "B-specific
";sleep 1}
-re ".*X2.*" {send "B-specific
";sleep 1}
}
expect {
-re ".*X.*" {send "D-specific
";sleep 1}
-re ".*X2.*" {send "D-specific
";sleep 1}
}
can sed or awk work this out?
if not..
maybe other tools suggested?
Answer Hi there. I was testing your shell script but I think that it is only a part of a bigger script, isn't it?
Can you provide more information about it, such as:
- The purpose
- the platform running (O.s)
- the shell type
- a little bit more of the shell-script.
I want to study it more in order to give you a more accurate response. Sorry for responding you so late.
Best regards.
Denis Vinny!
Add to this Answer Ask a Question
|
|