Debian Codegraph @

exercising-dd.sh

raw symbols SCIP
1 #!/bin/bash
2 # exercising-dd.sh
3
4 # Script by Stephane Chazelas.
5 # Somewhat modified by ABS Guide author.
6
7 infile=$0 # This script.
8 outfile=log.txt # Output file left behind.
9 n=8
10 p=11
11
12 dd if=$infile of=$outfile bs=1 skip=$((n-1)) count=$((p-n+1)) 2> /dev/null
13 # Extracts characters n to p (8 to 11) from this script ("bash").
14
15 # ----------------------------------------------------------------
16
17 echo -n "hello vertical world" | dd cbs=1 conv=unblock 2> /dev/null
18 # Echoes "hello vertical world" vertically downward.
19 # Why? A newline follows each character dd emits.
20
21 exit $?