Sponsored Content
Full Discussion: Shell basic graphics demo.
Top Forums UNIX for Dummies Questions & Answers Shell basic graphics demo. Post 302858235 by wisecracker on Sunday 29th of September 2013 04:39:23 PM
Old 09-29-2013
Shell basic graphics demo.

I have been thinking about another shell scripting project using the Arduino Diecimila board.
I was going to make a kids level slow 8 channel Logic Analyser.

I thought about using the termiinal esc code graphics characters.

This is the test code using said terminal escape codes. I have only tested this on the
default MB Pro, OSX 10.7.5, bash terminal.
I will need to test on various terminals and Linux variants before proceeding however.

Test code to see what could be done under bash:-
Code:
#!/bin/bash --posix
clear
echo ""
echo "Graphics characters and Logic Analyser display DEMO."
# Enable _extended_ graphics characters.
echo -e "\x1B(0"
echo -e "abcdefghijklmnopqrstuvwxyz\n"
echo "lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
echo "j                                                               "
echo "lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk                               "
echo "j                               mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
echo "lqqqqqqqqqqqqqqqk               lqqqqqqqqqqqqqqqk               "
echo "j               mqqqqqqqqqqqqqqqj               mqqqqqqqqqqqqqqq"
echo "lqqqqqqqk       lqqqqqqqk       lqqqqqqqk       lqqqqqqqk       "
echo "j       mqqqqqqqj       mqqqqqqqj       mqqqqqqqj       mqqqqqqq"
echo "lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   "
echo "j   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqq"
echo "lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk "
echo "j mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mq"
echo "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x "
echo "vqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvq"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"
# Disable _extended_ graphics characters.
echo -e "\x1B(B\x1B[0m"
echo "Graphics characters DEMO end."
echo ""

I am pleasantly surprised that it displays at all...
It certainly looks much better _in_the_flesh_...
Code:
Graphics characters and Logic Analyser display DEMO.

▒␉␌␍␊°±␤␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥

┌───────────────────────────────────────────────────────────────
┘                                                               
┌───────────────────────────────┐                               
┘                               └───────────────────────────────
┌───────────────┐               ┌───────────────┐               
┘               └───────────────┘               └───────────────
┌───────┐       ┌───────┐       ┌───────┐       ┌───────┐       
┘       └───────┘       └───────┘       └───────┘       └───────
┌───┐   ┌───┐   ┌───┐   ┌───┐   ┌───┐   ┌───┐   ┌───┐   ┌───┐   
┘   └───┘   └───┘   └───┘   └───┘   └───┘   └───┘   └───┘   └───
┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ 
┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ 
┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─
││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴

Graphics characters DEMO end.

AMIGA:barrywalker~> _

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

basic c-shell help

hello, i am very new to this, so i have basic questions about writing a shell. if i am working with a basic file, "main.c" and a shell file, "shell", what will the shell file look like? i want to change the command prompt from % to $, and i want to be able to have standard input from the... (0 Replies)
Discussion started by: ayalex
0 Replies

2. Shell Programming and Scripting

Helpless in basic shell sorting

Hi all; I need help in sorting and grouping the data in one flat file.The file look like this: 040171011140820070000000009650244002933170003000000075272 1F921338300506 01082007000014000000027665 1H912279980109 01082007000012000000042420 1S503377200110 01082007000014000000005187... (0 Replies)
Discussion started by: ashikin_8119
0 Replies

3. Shell Programming and Scripting

unix shell basic

need some help badly. if i had a file with content of few lines like the followings. 1183724770.651 0.049 137.157.56.169 200 415 GET http://venus/client/clients.xml "text/xml" 1183724770.651 0.049 141.183.101.250 200 415 GET http://venus/client/clients.xml "text/xml" using what command... (1 Reply)
Discussion started by: akagi07
1 Replies

4. Shell Programming and Scripting

how to get some sort of graphics using shell scripts?

Hi all, I would like to know how to have graphics embedded using shell scripts... I mean simple =========> or ---------> would do... The main idea here is for every element of the bar to move for every % completion of data..... I tried echo under a for loop ,but it was not giving me o/p that... (3 Replies)
Discussion started by: wrapster
3 Replies

5. Shell Programming and Scripting

Basic Shell Script Help

Lets say I wanted to create a script that would show what people are doing on my machine using the w command and refresh in about 6 seconds. What would be the easiest way to do this? I pretty much want the script to loop until I stop it. I'm using the BASH shell by the way. Help is appreciated.... (1 Reply)
Discussion started by: c4391
1 Replies

6. Shell Programming and Scripting

Basic shell script help

Im trying to make a script that simply adds a word to the last available line in a txt file without overwriting any previous lines. Ive googled this and there are great examples but no one explain what each function does, and i dont entirely understand how it works. Basically Im looking for... (7 Replies)
Discussion started by: kylecn
7 Replies

7. OS X (Apple)

[Solved] links2 --enable-graphics from source, configure error: no graphics driver found.

Howdy I am trying to install links2 with graphics support on snow leopard 10.6.8 (xcode installed). I have had the program running last year, also installed from source - but then I had installed some image libraries with mac ports and fink - cannot reproduce that setup. Plus I would like to not... (6 Replies)
Discussion started by: butterbaerchen
6 Replies

8. UNIX for Dummies Questions & Answers

Shell BASIC interpreter(s)...

I am looking for a simple BASIC Interpreter written in a shell scripting language. For me something like this would be a great learning tool... After much goggle eyed Googling I came upon this:- https://gist.github.com/cander/2785819 It is small and I haven't tried it yet as I am at work... (6 Replies)
Discussion started by: wisecracker
6 Replies

9. UNIX for Dummies Questions & Answers

Basic Shell Scripting

Hi All, I am a newbie to shell scripting. I am trying to something like this. #!bin/bash cd /u01/app/oracle/ # then start the process ./opmnctl startall Can someone help me with this requirement. Help is very much appreciated. Thanks Venkat Please use code tags next time for... (10 Replies)
Discussion started by: venkat8439
10 Replies
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy