php-faketerm/examples/dd.ftm

100 lines
1.7 KiB
Plaintext

set terminal 80x10
set typedelay 100
set fps 30
sub prompt
write <home> <sgr fg:green bold> user@host <sgr> : <sgr fg:blue bold> $1 <sgr bold> " $ " <sgr>
delay 500
endsub
write <sgr bold> "dd" <sgr> " - convert and copy a file" <return>
write u{2500} *80 <return>
mark %top
write <sgr fg:cyan bold> Example 1: <sgr fg:cyan> " Creating a disk image" <sgr> <return> <return>
prompt "~"
type "dd "
delay 1000
mark dd-if
type "if=/dev/sdb "
annotate @dd-if "Input file\n(Source)" at dd-if
annotatelength @dd-if 11
delay 2000
mark dd-of
type "of=image.img "
annotate @dd-of "Output file\n(Destination)" at dd-of
annotatelength @dd-of 12
delay 2000
mark dd-bs
type "bs=16M "
annotate @dd-bs "Block\nsize" at dd-bs
annotatelength @dd-bs 6
delay 2000
mark dd-status
type "status=progress "
annotate @dd-status "Show progress" at dd-status
annotatelength @dd-status 15
delay 2000
write <return>
delay 2000
clearannotate
moveto %top
clear to-bottom
delay 500
write <sgr fg:cyan bold> Example 2: <sgr fg:cyan> " Create a file with empty data" <sgr> <return> <return>
prompt "~"
type "dd "
delay 1000
mark dd-if
type "if=/dev/zero "
annotate @dd-if "Reading from\n/dev/zero will\nreturn '0'\nindefinitely" at dd-if
annotatelength @dd-if 12
delay 2000
mark dd-bs
type "bs=1M "
annotate @dd-bs "Block\nsize" at dd-bs
annotatelength @dd-bs 5
delay 2000
mark dd-count
type "count=100 "
annotate @dd-count "Number of\nblocks to\ncopy:\n100*1M=100MB" at dd-count
annotatelength @dd-count 9
delay 2000
mark dd-of
type "> "
annotate @dd-of "Without of= the output\nwill go to standard output,\nwhich can be redirected" at dd-of
annotatelength @dd-of 1
delay 2000
type "empty.img"
write <return>
delay 2000
clearannotate
moveto %top
clear to-bottom
delay 500