EXPECT: Assign variable by reading a line of text from a file
Hi All,
I have been using a program on windows called AutoKey.
My environment at work is Linux and I have been experimenting with expect. Very powerful. I can move my AutoKey scripts to Linux using Expect once I am educated on how to read from a file using Expect.
My application would be as follows:
1. I have a list of MAC addresses in a text file format aa:bb:cc:dd:ee:ff. There will be one MAC address per line.
2. Expect script will need to read the first mac address in the file. Carry out some work with that MAC and then read the next MAC address and so on until the end of the file.
I have a script which works fine as follows, but the MAC is prompted by the user. This is the part which needs to be automated and the MAC address read from the line in the file so the MAC read from the file is the variable for.
I would appreciate some guidance on how to use expect to read the first line of a file, carry out the work needed with the MAC, and then loop back and get the next MAC until the end of the list.
This is Windows (sorry ) autokey script which reads from a file:
Hi,
I am doing :
while read line
do
printf "%s\n" ${line}
done <datafile.txt
but I am not getting each single line from the data file assigned to the variable line (but only tokens/fields at a time). I also tried while IFS= read -r lineI want the whole line assigned or read into the... (2 Replies)
Hello All,
A part of my very basic perl code requires me to read a single value from a text file.
The file output is the following:
Reading image ... done
IMAGEREGION=0x0x0-256x162x256
VOXELDIMENSION=0.9375000000x1.2000000477x0.9375000000
VOXELNUMBER=10527001... (7 Replies)
Hi,
I have a text file something like this:
10.10.10.1,
ldap,
cn=users,dc=example,dc=com
.....
...
and many more lines
...
...
now i want to read each individual line from the file and assign it to a variable
example:
the script should read 10.10.10.1 and assign it to a variable say... (3 Replies)
Hi,
I have a text file with multiple lines, each having data in the below format
<DOB>,<ADDRESS>
I have to write a script which reads each line in the text file in loop, assign the values to these variables and do some further processing in it.
Using the following code prints the... (1 Reply)
Hi,
I have a text file with multiple lines, each having data in the below format <DOB>,<ADDRESS>
I have to write a script which reads each line in the text file in loop, assign the values to these variables and do some further processing in it.
Using the following code prints the values... (12 Replies)
So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated.
Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Hi,
I am new to shell scripting. Need help with the below requirement.
I need help to read a log file and line containing word ORA needs to be captured into a variable and the values of the variable need to be inserted into a table.
For E.g. file test.sql has below error:
ORA-01017:... (3 Replies)
Hello,
I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop ,
while IFS=: read -r line
do
set $dsc=$line
echo 'printing line variable ' $line... (1 Reply)
Hello,
I have a text file named "foreach.txt" which reads like ---
foreach cal ( 1 2 3 4 5 )
I am using a simple script which looks like ---
#!/bin/tcsh
foreach cal (1 2 3 4 5)
echo "$cal"
end
Is it possible to modify the script in such a way that instead of writing
foreach cal (1... (6 Replies)
Discussion started by: Indra2011
6 Replies
LEARN ABOUT DEBIAN
dssi_osc_send
dssi_osc_send(1) General Commands Manual dssi_osc_send(1)NAME
dssi_osc_send - send OSC messages to DSSI applications.
SYNOPSIS
dssi_osc_send <option> <OSC URL> <values>
DESCRIPTION
dssi_osc_send sends DSSI OSC methods to DSSI applications. dssi_osc_send is typically used to control DSSI hosts (possibly for scripted
operation), or to test DSSI user interfaces.
OPTIONS -c Send a `control' message. Requires two values to be supplied in the <values> section: control port and value. For example, to set
control port 1 to 0.1:
dssi_osc_send -c <OSC URL> 1 0.1
-p Send a `program' message. Requires two values to be supplied in the <values> section: bank and program number. For example, to
select bank 0 program number 7:
dssi_osc_send -p <OSC URL> 0 7
-m Send `midi' message. Requires four numbers to be supplied in the <values> section. For example, to send a note on, middle C,
velocity 64:
dssi_osc_send -m <OSC URL> 0 144 60 64
-C Send a `configure' message. The <values> are the key and value pair. For example, to send key `load' and value `/tmp/patches.pat':
dssi_osc_send -C <OSC URL> load /tmp/patches.pat
-s Send a `show' message.
dssi_osc_send -s <OSC URL>
-h Send a `hide' message.
dssi_osc_send -h <OSC URL>
-q Send a `quit' message.
dssi_osc_send -q <OSC URL>
-e Send a `exiting' message.
dssi_osc_send -e <OSC URL>
<OSC URL>
The URL to connect to. For example:
osc.udp://localhost:19383/dssi/test.1
osc.udp://my.host.org:10886/dssi/xsynth-dssi/Xsynth/chan00
SEE ALSO dssi_osc_update(1).
AUTHOR
This manual page was originally created by Mark Hymers from the help text of the application, for the Debian project (but may be freely
used by others).
January 5th, 2009 dssi_osc_send(1)