File: if-batchmode.cir

package info (click to toggle)
ngspice 44.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 73,372 kB
  • sloc: ansic: 560,757; cpp: 17,623; xml: 9,372; makefile: 4,076; sh: 2,664; perl: 2,442; yacc: 1,549; tcl: 1,040; lex: 320; pascal: 241; python: 179
file content (31 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use $batchmode

* use $batchmode variable to steer control flow
*
* start either with
*    ngspice -b -r rawfile.raw if-batchmode.cir
* or with
*    ngspice if-batchmode.cir

v0  1 0  dc 1
R1  1 2  1k
C1  2 0  1u

.tran 100u 10m uic
.print tran all

.control

if $?batchmode
  echo "Info: batchmode has been set by command line option -b"
  echo
else
  echo "Info: batchmode has not been set"
  echo
  unset ngdebug
  tran 100u 10m uic
  plot v(2)
end

.endc
.end