Appendix A. Appendix—Commands and Variables

This appendix is a listing of the commands, flags, and variables built into Expect (not including those provided by Tcl). The listing does not show the complete syntax for each command or flag; this is just an aid to jog your memory as to what is available. Alongside each entry is a brief description and a page number. The page number points to where the command is best described, not necessarily where it first or literally appears.

I have omitted information that is redundant (such as the timestamp substitutions which can all be found on the page which describes timestamp) and the debugger commands (which can be produced by pressing h while in the debugger). I have also omitted commands specific to C and C++ programming since that information is well confined to two short chapters. You can also find all of this in the index.

All of the commands shown here that do not start with "exp" are also callable with the "exp_" prefix. For instance, close can also be called as exp_close.

Commands And Flags

close

close spawned process

Page 101

         −i

         identify process

245

         -slave

         close slave of process

291

debug

control debugger

406

         -now

         start debugger immediately

407

         0 or 1

         stop or start debugger

406

disconnect

disconnect process from tty

371

exit

exit

35

         -onexit

         declare exit handler

317

         -noexit

         invoke exit handlers but do not exit

317

         #

         exit with this value

35

exp_continue

continue expect command

142

         -continue_timer

         do not restart internal timer

144

exp_internal

control internal diagnostics

162

         -info

         return state

178

         -f

         direct diagnostics to file

169

         0 or 1

         stop or start diagnostics

167

exp_open

open spawned process as file identifier

300

         −i

         identify process

300

         -leaveopen

         leave spawned process accessible

301

exp_pid

return process id

300

         −i

         identify process

300

exp_version

return version of Expect

522

         -exit

         exit if version mismatch

522

         version

         version needed by script

522

expect

wait for pattern

72

         timeout

         match timeout

94

         eof

         match eof

98

         full_buffer

         match full buffer

149

         default

         match timeout or eof

101

         null

         match null

153

         -brace

         arguments are braced

158

         -gl

         glob pattern

109

         -re

         regular expression

109

         -ex

         exact string

132

         -notransfer

         do not update internal buffer

151

         -nocase

         treat input as all lowercase

137

         −i

         identify process

243

         -indices

         save indices of match

123

         pattern action ...

         pattern action pairs

75

expect_after

wait for pattern before others

255

 

         same flags as for expect, plus

 

         -all

         return patterns of all spawn ids

262

         -info

         return patterns

262

         -noindirect

         do not return patterns of indirects

265

expect_background

wait for pattern in background

441

 

         same flags as for expect_after

 

expect_before

wait for pattern after others

255

 

         same flags as for expect_after

 

expect_tty

wait for pattern from terminal

205

 

         same flags as for expect

 

expect_user

wait for pattern from user

188

 

         same flags as for expect

 

fork

create child process

370

inter_return

return from caller

226

interact

pass control of process to user

82

         eof

         match eof

337

         timeout

         match timeout

338

         null

         match null

338

         -brace

         arguments are braced

320

         -re

         regular expression

324

         -ex

         exact string

323

         -input

         input processes

349

         -output

         output processes

349

         -u

         substitute for user process

346

         -o

         process patterns

323

         −i

         identify process

345

         -echo

         echo

329

         -nobuffer

         do not buffer partial matches

333

         -indices

         save indices of match

324

         -reset

         reset terminal mode

340

         -iwrite

         save process spawn id

355

         pattern action ...

         pattern action pairs

320

interpreter

pass control of Expect to user

221

log_file

control output saving to file

176

         -a

         save all output

177

         -noappend

         save to beginning of file

176

         -info

         return state

178

         -leaveopen

         treat file as log

176

         -open

         treat file as log

176

         file

         save output to file

176

log_user

control output to screen

171

         -info

         return state

178

         0 or 1

         stop or start output

171

match_max

control match buffer size

148

         -d

         default (future processes)

148

         −i

         identify process

245

         #

         new buffer size

148

parity

control parity

154

         -d

         default (future processes)

154

         −i

         identify process

245

         0 or 1

         strip or preserve parity

154

prompt1

prompt after complete command

224

prompt2

prompt after incomplete command

224

remove_nulls

control nulls

153

         -d

         default (future processes)

153

         −i

         identify process

245

         0 or 1

         preserve or strip nulls

153

send

send string

71

         

         treat next string as literal

278

         −i

         identify process

243

         -h

         send humanly

273

         -s

         send slowly

271

         -null

         send null

277

         -raw

         do not insert returns

194

         -break

         send break

277

         string

         string to be sent

71

send_error

send to standard error

183

 

         same flags as send

 

send_log

send to log

178

         

         treat next string as literal

278

         string

         string to be sent

178

send_tty

sent to /dev/tty

206

 

         same flags as send

 

send_user

send to standard output

181

 

         same flags as send

 

sleep #

         sleep number of seconds

192

spawn

start a process

78

         -console

         treat process as console

296

         -ignore

         ignore signal

306

         -leaveopen

         treat file as spawned process

285

         -open

         treat file as spawned process

285

         -noecho

         do not echo spawn command

294

         -nottycopy

         do not initialize pty like /dev/tty

296

         -nottyinit

         do not do sane initialization

296

         -pty

         allocate pty without starting process

289

strace

trace statements

401

         -info

         return state

401

          #

         depth to which to trace

401

stty

modify terminal parameters

193

         <ttyname

         terminal to modify

200

         raw

         raw mode

194

         -raw

         cooked mode

195

         cooked

         cooked mode

201

         -cooked

         raw mode

201

         echo

         echo

195

         -echo

         no echo

195

         rows [#]

         set or return rows

201

         columns [#]

         set or return columns

201

          local-stty-args

         execute native stty command

201

system local-cmd

         execute Bourne shell command

203

timestamp

return timestamp

522

         -format

         timestamp format

522

         -seconds

         time source

522

trap

define signal handler

303

         -code

         code to return

316

         -interp

         interpreter to use

316

         -name

         return name of current signal

305

         -number

         return number of current signal

305

         -max

         return number of signals

314

         action signal-list

         action to execute upon signals

305

wait

wait for process to go away

105

         −i

         identify process

245

         -nowait

         wait for process in future

106

Variables

any_spawn_id

any listed spawned process

254

argc

number of initial arguments

210

argv

initial arguments

210

argv0

name of script

210

dbg

debugger breakpoint regexp results

418

error_spawn_id

spawn id of standard error

241

exp_library

platform-independent utility scripts

520

exp_exec_library

platform-dependent utility scripts

520

expect_out

results of expect

111

interact_out

results of interact

324

send_human

controls for send -h

273

send_slow

controls for send -s

271

spawn_out

results of spawn

290

spawn_id

currently spawned process

229

stty_init

stty parameters for spawn

296

timeout

maximum time for expect to wait

75

tty_spawn_id

spawn id of /dev/tty

241

user_spawn_id

spawn id of standard input and output

241

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.84.155