Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Colour-bars-Display/UNIX-Shell/colour-bars-display.sh
Normal file
24
Task/Colour-bars-Display/UNIX-Shell/colour-bars-display.sh
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
clear
|
||||
WIDTH=`tput cols`
|
||||
HEIGHT=`tput lines`
|
||||
NUMBARS=8
|
||||
BARWIDTH=`expr $WIDTH / $NUMBARS`
|
||||
|
||||
l="1" # Set the line counter to 1
|
||||
while [ "$l" -lt $HEIGHT ]; do
|
||||
b="0" # Bar counter
|
||||
while [ "$b" -lt $NUMBARS ]; do
|
||||
tput setab $b
|
||||
s="0"
|
||||
while [ "$s" -lt $BARWIDTH ]; do
|
||||
echo -n " "
|
||||
s=`expr $s + 1`
|
||||
done
|
||||
b=`expr $b + 1`
|
||||
done
|
||||
echo # newline
|
||||
l=`expr $l + 1`
|
||||
done
|
||||
|
||||
tput sgr0 # reset
|
||||
Loading…
Add table
Add a link
Reference in a new issue