jr@saturn:~> cat `which rigol-screenshot ` #!/bin/sh echo ':disp:data?' | netcat 192.168.4.52 5555 | dd bs=1M iflag=skip_bytes skip=11 of=$1 echo $? jr@saturn:~> rigol-screenshot xxx.bmp 0+903 Datensätze ein 0+903 Datensätze aus 1152057 Bytes (1,2 MB) kopiert, 2,98393 s, 386 kB/s 0
#!/bin/bash # usage: rigol-snapshot <filename_with_wellknown_imagefile_extension> # e.g.: rigol-snapshot pics/test.jpg # fetches a bmp formatted screenshot picture from Rigol DS1000 series, via ethernet # TODO: proper handling of broken connection to Rigol, check netcat / read return code RIGOL_IP=192.168.4.52 # adapt to your local situation, I used fixed DHCP IP for rigol in my router set -e -u #might improve the TODO error handling as mentioned above. untested!! echo ':disp:data?' | netcat -w 1 $RIGOL_IP 5555\ | (shopt -s extglob;\ read -N 1 -t 0.1 magichash; read -N 1 -t 0.1 lenofnum; read -N $lenofnum -t 0.1 numofbytes; head -c ${numofbytes##*(0)} ; echo "magic: $magichash; len: $lenofnum; bytes: ${numofbytes##*(0)}" >&2\ )\ | convert bmp:- $1 echo "returncode: $?" >&2