Linux World
Pages
Home
Programming
Computer Architecture
Tit Bits
Trouble Shoot
Kernel Related
Quizzes
Linux Tips
Follow @Linux_world
Search
Generate Indian Flag on the Linux Terminal
Here is a script to generate something close to India Flag on the linux Terminal. The output looks as shown in he figure below .
horizontal() { hrow=$2 hstart=$1 hcols=$3 char=$4 end=$((hstart + hcols)) for((i=hstart;i<=end;i++)) do tput cup $hrow $i printf "$char" done echo"" } set_color(){ tput setaf 2 } clear tput setab 3 for((k=0;k<=7;k++)) do horizontal 2 $k 160 " " #echo $i #horizontal 2 1 80 "*" #horizontal 2 2 80 "*" done tput setab 7 for((k=8;k<=15;k++)) do horizontal 2 $k 70 " " done tput setab 4 for((k=8;k<=15;k++)) do horizontal 50 $k 80 " " #echo $i #horizontal 2 1 80 "*" #horizontal 2 2 80 "*" done tput setab 7 for((k=8;k<=15;k++)) do horizontal 80 $k 160 " " #echo $i #horizontal 2 1 80 "*" #horizontal 2 2 80 "*" done tput setab 2 for((j=16;j<=23;j++)) do horizontal 2 $j 160 " " #echo $i #horizontal 2 1 80 "*" #horizontal 2 2 80 "*" done
Save the file as the flag.sh and run it in the terminal, with terminal in the full screen.
$ bash falg.sh
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment