Shell BASIC interpreter(s)...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Shell BASIC interpreter(s)...
# 1  
Old 03-27-2013
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 ATM.

However does anyone out there know of a cool BASIC Interpreter written in "bash"?

TIA...
# 2  
Old 03-27-2013
Asking for one written in shell script limits your options a lot.

I can't help but wonder why, though.
# 3  
Old 03-27-2013
Given that bash is supposed to accept Bourne shell syntax, why not just use bash to execute the Bourne shell BASIC interpreter provided? Sure, it will be SLOW and maybe you can make use of some extended bash features to speed it up a little, but I agree with Corona688: Why would we want to waste our time reinventing this wheel?
# 4  
Old 03-27-2013
The reason is I learn "languages" best when it is adapted to something I am interested in.

"Banging the metal" is my forte and the AudioScope is an example of my abilities, albeit with a somewhat primitive coding style presently.

Any language that can create a BASIC interpreter no matter how small usually has some tricks up its sleeve(s), and this is the main reason.

I respect those coders who can create OSes, (I am a member of MikeOS), and have contributed HW related stuff:-

MikeOS - simple x86 assembly language operating system

One being a modified USB KB to give a slow serial I/O for a BIOS only OS.

Also those who can create compilers and interpreters get my vote too.

When studying the code for these things I learn a great deal.

UNIX style shell scripting is my new "platform" FTTB and with your input I am learning complex stuff very quickly. I still search continuously via Google for strange requirements for the Scope and enjoy every minute of it.

You have inadvertently become my mentor and all I can say is thanks...

Now you know... ;o)
# 5  
Old 03-27-2013
"Because I find it interesting" is a good enough reason really Smilie

I admit, gwbasic and qbasic were the handiest, quickest languages for graphics I ever used... Just screen 12, line x1,y1 - x2,y2 and you've got a line, no need for 4 paragraphs of libraries and window initialization code. I know of no modern equivalent that's so charmingly straightforward. I still fire it up in dosbox sometimes for quick and dirty experiments.

Of course, BASIC also has egregious limits too, but it is what it is.
# 6  
Old 03-27-2013
Hi.

Google search of linux basic interpreter led me to things like this:
Quote:
BaCon BASIC (Linux, Mac OS X, *BSD)

BaCon BASIC is a BASIC to C translator for Unix-based systems (like Linux, FreeBSD, Mac OS X, etc), which means that it takes your BASIC code and changes it into C source code. You will then need a C compiler to compile that code. At this time, the converter appears to be implemented using shell scripts, and you will need either the BASH or Korn shell to run it. (Note: if you are using Linux, chances are that you already have BASH somewhere on your system. I'm not sure about the other systems, though.)
--http://www.thefreecountry.com/compilers/basic.shtml

That might get you started -- if the parser is written as a shell script, then part of your work is done. There were 4 million hits on the Google search.

Best wishes ... cheers, drl
# 7  
Old 03-27-2013
Hi drl...

I have already seen BaCon BASIC from Googling, thanks nevertheless...

Due to an infraction on my part I am in -ve equity and this might not be posted.

So if it is I am now rigged for silent running for a while...

See you guys and hopefully this will be uploaded...

BFN...

Bazza...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Solaris

Perl Interpreter Default Shell

Hello. We have recently changed from HP Unix Servers to Solaris. On the HP Severs we were using the POSIX shell. Solaris is using the Bourne sh. We are using ksh as our default shell after login. The problem we are encountering is when something like Perl or Cron uses the shell to execute a... (5 Replies)
Discussion started by: mix123
5 Replies

3. UNIX for Dummies Questions & Answers

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... (2 Replies)
Discussion started by: wisecracker
2 Replies

4. 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

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

Test for shell interpreter at beginning of script

What would be the best way or method to determine or test for the shell interpreter at the beginning of a script in the event one shell is not available? If I use the following: #!/bin/bash and /bin/bash is not available, then use I'd like to use /bin/ksh if it is available. #!/bin/ksh (8 Replies)
Discussion started by: nck
8 Replies

7. UNIX for Dummies Questions & Answers

Shell and commandline interpreter-definitions

What is the difference between the(a) shell and the (a) command-line interpreter? Here we're talking about the complete dummy question, but could someone point me right. (yes, have written scripts in for instance bash shell, and and grepp-ed my way around ....:eek: (4 Replies)
Discussion started by: amkgw
4 Replies

8. 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

9. Windows & DOS: Issues & Discussions

rediretion and pipes in DOS shell cmd interpreter

Hello, I am trying to accomplish the following. Send the output of a command to the screen (this happens by default) as well as capture the output of the screen to a log file. How can this be achieved in DOS command interpreter syntax. Any ideas/suggesstions/indicators are greatly... (2 Replies)
Discussion started by: jerardfjay
2 Replies

10. 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
Login or Register to Ask a Question