06-13-2012
Expect scripting - How to match a double quotes " "
I am trying to match a text which contains the " ", from the log file. But it doesn't match. I understand that " " has got a special meaning to TCL/Expect.
hence I tried the following, but no luck.
expect -ex {
"lp -c -demail -ot\\\"firstname_surname@gmail.com\\\" /usr/local/spool/pf"
{
incr logged
send_user "\r\n LOGGED #4, $logged \r\n"
}
timeout
I tried using \ , \\ and \\\ but no luck yet.
Can anyone help, Please..
My log file contains the following line,
exec [lp -c -demail -ot"firstname_surname@gmail.com" /usr/loc
al/spool/pf/context/ABC001-1209236.mime]
and I need to match that line.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello to all,
Does anyone know the solution ?
Two strings A and B are present. I want to check whether B is a Substring of A.
1. The value of A is - 29 * * * /bin/ls "test" "tmp*" "log*"
(Note: Pl note that A contains DOUBLEQUOTES, ASTERISK & FRONTSLASH)
2. The value of B is -... (5 Replies)
Discussion started by: rssrik
5 Replies
2. Shell Programming and Scripting
Hi Experts,
I have a file with some of the records contain double quotes. If I found a double quote(") in any particular record , I need to look for the next double quote in that particular record and in between these quotes, if any comma(,) is there I need to replace with Tilde (~) in the same... (12 Replies)
Discussion started by: vsairam
12 Replies
3. Shell Programming and Scripting
I am writing a expect script. during the expect, i need check the out to see whether i logged in:
set password "1234"
spawn telnet host1
expect "login:"
send "guest\n"
expect "password:"
send $password
expect -re "#|$"
puts "Logged in"
But it seems that expect takes "$" as a wild... (3 Replies)
Discussion started by: sleepy_11
3 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
Hello All,
I am writing an Expect Script to execute some commands over ssh then exit the script.
The script works just fine if I automate everything and assuming the correct password was entered.
So this Expect Script gets executed from a Bash script... From the Bash script I pass along an... (0 Replies)
Discussion started by: mrm5102
0 Replies
6. Shell Programming and Scripting
Hi,
I have the following text in a file
<div class="snippet abstract">
We present a new "model" for multiple-input-multiple-output (MIMO) 'outdoor'
has many things "what" ever
</div></a href=sdfkkf">
</div>
<div class="snippet context">
I have to replace the string between the <div... (1 Reply)
Discussion started by: vms
1 Replies
7. UNIX for Advanced & Expert Users
Hi, everyone.
I need to write a program to get io info based on libperfstat.
But the "write time" of a disk is just half of the value get from iostat.
I'm confused and can't explain. Help please.
How I calculate "write service time per sec":
In iostat:
write service... (0 Replies)
Discussion started by: jackliang
0 Replies
8. Shell Programming and Scripting
Hi All,
i am trying to ssh to a remote machine and execute certain command to remote machine through script.
i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as
expect: spawn id exp5 not open
while executing
"expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies
9. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
10. Shell Programming and Scripting
I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for:
my.cnf
/bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf
after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
LEARN ABOUT REDHAT
vboxgetty
vboxgetty(8) Linux System Administration vboxgetty(8)
NAME
vboxgetty - isdn voice box (getty)
SYNOPSIS
vboxgetty [OPTION] [OPTION] [...]
DESCRIPTION
Vboxgetty is the heart of vbox: it watches the isdn system and waits for incoming voice calls,
OPTIONS
-f, --file FILE
Config file to use. Default is the file '/etc/isdn/vboxgetty.conf'.
-d, --device TTY
ISDNdevice to use. You must use this option!
-h, --help
Show summary of options.
-v, --version
Show version of program.
CONFIGURING VBOX
vboxgetty should be started from the init process. To do this you need one line per vboxgetty in /etc/inittab like this one:
I5:2345:respawn:'/usr/sbin'/vboxgetty -d /dev/ttyI5
The next step is to set up a working configuration for all ports in /etc/isdn/vboxgetty.conf: read vboxgetty.conf(5) how to do this and
look at the example config file in /usr/doc/isdnutils/examples.
You should then create the spool directories for each user: /var/spool/vbox/<user>, /var/spool/vbox/<user>/incoming and
/var/spool/vbox/<user>/messages. Copy the example config files vbox.conf and standard.tcl from /usr/doc/isdnutils/examples to
/var/spool/vbox/<user>, read the man pages vbox.conf(5) and vboxtcl(5) and edit these config files.
Change the owner of all files in /var/spool/vbox/<user> with "chown <user>.<group> /var/spool/vbox/<user> -Rv" and correct the permissions
with "chmod o-rwx,g-rwx /var/spool/vbox/<user> -Rv".
The last step: run "init q" to force init to reread /etc/inittab
HOW IT WORKS
For each line in /etc/inittab one vboxgetty is started by init. Make sure the first field (ID) and the device file are different. Each
vboxgetty does this:
First /etc/isdn/vbox.conf is read, the global settings are loaded and then the port specific settings. Then vboxgetty waits for an incoming
call.
On an incoming call vboxgetty reads /var/spool/vbox/<user>/vbox.conf (unless you change that name), and vboxgetty determines if it should
take that call or how many RINGs it should wait. It also gets the name of the standard message, beep message, timeout message, if these
should be played and an alias for the current caller, if there is one.
If vbox has waited enough RINGs and the caller is still ringing, it takes the call and starts the tcl script /var/spool/vbox/<user>/stan-
dard.tcl (unless you change that name), and this script will do the rest (normally: play standard and beep message, record and then play
timeout message).
FILES
/etc/isdn/vboxgetty.conf
default config file
/etc/inittab
init starts vboxgetty via this file.
/etc/isdn/vboxgetty.conf
the global vbox config file
/var/spool/vbox/<user>/vbox.conf
the per user configuration file for this port
/var/spool/vbox/<user>/standard.tcl
the tcl script used to communicate with the caller
/var/run/vboxgetty-<device>.pid
process id of the vboxgetty
/var/log/vbox/vboxgetty-<device>.log
logfile of the vboxgetty
SEE ALSO
vboxgetty.conf(5), vbox.conf(5), vboxtcl(5), isdntime(5)
AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux.
ISDN 4 Linux 3.1pre4 2000/09/15 vboxgetty(8)