LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-15-2017, 05:03 PM   #1
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Rep: Reputation: 3
Using a Linux script to generate dotted lines at various angles in real time


2017-10-15

Long ago I was able to use BASIC to generate dotted lines at various angles to form different symbols and shapes in real time. Is there a simple way in Linux which will enable me to achieve the same objective by writing a bash script?

Thanks to all in advance for your kind advice.

Julianvb
 
Old 10-16-2017, 06:11 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,190

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
It can be done. It is not particularly simple.
Your constraints for pure shell and speed are: integer math, character output, terminal screen dimensions in characters.

If you want graphics (pixel) resolution and better speed, this is nicely solved by using C, C++, Pascal, TCL/TK, or even basic. I have never investigated basic graphic functions under Rust, Python, or Perl but those are also interesting options. Shell can DO almost anything, but this is not something it is designed to do WELL.

Why do you want to use shell, and would using tcl/tk functions from the shell interest you?
 
Old 10-16-2017, 09:46 PM   #3
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Quote:
It can be done. It is not particularly simple.
Your constraints for pure shell and speed are: integer math, character output, terminal screen dimensions in characters.

If you want graphics (pixel) resolution and better speed, this is nicely solved by using C, C++, Pascal, TCL/TK, or even basic. I have never investigated basic graphic functions under Rust, Python, or Perl but those are also interesting options. Shell can DO almost anything, but this is not something it is designed to do WELL.

Why do you want to use shell, and would using tcl/tk functions from the shell interest you?
Hi, wpeckham,

Thanks very much for your good suggestions.
This is just a random thought on my part. I wrote a conventional mortgage-loan program in C++ about 7 years ago in a couple of days after I became dissatisfied with a banker's answers. I wish to make this task as simple as possible as I am a retiree busy with daily household chores and yard work. I'll look into tcl/tk shell functions next as you suggest.

Julianvb

Last edited by julianvb; 10-16-2017 at 10:38 PM.
 
Old 10-17-2017, 09:18 AM   #4
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,190

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
To be exact, tck and tk are not shell functions or built into the shell. They are, however, easily integrated into applications and can be called for window and graphic control and are suitable for some kinds of light programming.

There may be other ways to do pixel mapping and graphics or line drawing from the shell, but I have not played with that often.

An option I HAVE played with is generating data sets using a shell or perl script and then calling gnuplot or ploticus to then draw the plot in a window, generate a web page with the image, or create and graphic file containing the plot. These applications give you very extensive and precise control over the appearance of the output, and I find them fun to play with.
Something to investigate, if you have some time.
 
1 members found this post helpful.
Old 10-17-2017, 09:45 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,351
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Learning how to do this with a shell script is probably going to cause a lot more headaches than it solves compared to the alternatives.

If you are already familiar with C++ coding, then using C++ is probably the best option. However, if your C++ skills are rusty, then it's possible you could get up and running more easily with python or javascript.
 
1 members found this post helpful.
Old 10-17-2017, 11:04 AM   #6
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
wpeckham and IssacKuo,
Thanks very much for your helpful advice.
Julianvb
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash script: generate 1000 lines for SQL Lexus45 Linux - Software 1 03-19-2015 08:29 AM
[RTAI] Can POSIX real time signals result in soft real time? TheIndependentAquarius Linux - Newbie 0 04-21-2012 06:14 AM
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 11:54 AM
LXer: Real Time Coming to Linux Real Soon LXer Syndicated Linux News 1 08-23-2006 07:30 PM
Patch to remove GTK dotted lines... 3saul Linux - Software 3 11-08-2005 12:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration