Join The Cleveland Area COBOL Meetup Group

You'll get invited to our Meetups as soon as they're scheduled!

GNU and Dreamhost Basics

For the Class here are some basics to understand.

In order to make sure we are all on the same version of OpenCobol, and have the same options, I've set up a user on my Dreamhost account. We all will be sharing the same user, but using different folders inside of that user. You will need to connect through SSH (Secure SHell) and there are several ways to do so. (Secure Shell lets you connect to another computer, via Command Line/Terminal. Once logged in all commands are as if you were in that computer.) In all cases the information you connect with will be the same.

domain or host: gwenyfer.com
User: you will be sent this upon joining.
Password: you will be sent this upon joining.

From a GNU (Linux/BSD etc) or any other unix type computer system, from the TERMINAL type:
ssh user@gwenyfer.com
You will be asked for the password, enter it and you should be logged in. To verify you are logged in type ls (that is LOWERCASE LS) and hit enter, and you will see a list of directories including one called users.

From a windows system you will need to download putty which allows you to access SSH from a windows machine. When you download, choose the putty.exe program and save it to your desktop. It does not install, but will just save as a file. When you wish to connect to gwenyfer.com double click on the putty.exe on your desktop. At the screen that pops up click RUN if you get such a screen (this will happen on newer Windows OS installations).

Once putty is running type gwenyfer.com in the HOST NAME (or IP ADDRESS) field and click OPEN. Then a screen will pop up asking for your username. Type in the one you have been provided with and hit enter. Then type your password and hit enter.

Some commands to keep in mind once you have entered the gwenyfer server.

l <enter-key> (That's lowercase L, which gives you a nicely formated list of files in the current directory).
cd directory name (changes you to the directory in question).
cd users/yourname (changes you to your working directory).
cd lesson### (lesson001, lesson002 etc, changes you to the particular lesson in question)

NOTE: Most commands are in lowercase. Also it is a good idea to get in the habit of typing lowercase L after changing directories to verify you are in the right place.

nano filename (editor which lets you edit the file in question such as:
nano multiplytest.cob

NOTE: nano has a mini help at the bottom when you are running it, so always take a look at that. Each command in the help is in the form ^LETTER, so for instance ^O or ^X. In each case ^ represents the CTRL key. So hold down the CTRL key and then tap ONCE, the letter following.

Some useful nano commands:
^O writeOut to save files. It will ask the filename, just hit enter to save the current file.
^X eXit to close out of nano. If you have made changes nano will ask if you want to save the current file. Y to save, N to close nano and not save.
ALT-S to enable smooth scrolling.

Compiling with OpenCobol:
All cobol programs require compilation. This converts them from words, to a binary executable. To compile:
cobc -x filename.cob

So for instance to compile multiplytest.cob:
cobc -x multiplytest.cob

If there are any errors you will get a message like the following:
filename.cob:12: Error:

The error message tells you exactly which file contains the error, following by the colon and then the line number where the error is, and finally the error itself.

If you are just returned back to the command line, then there are no errors and you can run the prorgam you have just compiled.

To run the program, make sure you are in the directory where it is located (the same directory as the filename.cob). Then type the following command:
./filename (without the .cob at the end, this will only work if you ran cobc -x filename.cob).

So for instance if you compiled multiplytest.cob the command would be:
./multiplytest

So finally the steps to work are:

1. Log into dreamhost via putty or ssh username@gwenyfer.com.
2. Change directories to your user directory via cd users/yourname (NOT your username), such as cd aoirthoir.
3. Change directories to the lesson in question via cd lesson### (such as cd lesson001).
4. Edit the file in question via nano such as nano multiplytest.cob
5. Compile the file in question via cobc -x such as cobc -x multiplytest.cob
6. Run the program you just compiled via ./filename such as ./multiplytest
7. When you are all finished exit out of SSH via exit <ENTERKEY>

For any questions feel free to contact me via email or 440-541-7214

Recently updated pages

Page title Most recent update Last edited by
GNU and Dreamhost Basics October 7, 2009 7:12 PM Aoirthoir An Broc
Photo Copyrights June 4, 2007 11:32 PM Aoirthoir An Broc
About this Meetup Group October 7, 2009 6:56 PM Aoirthoir An Broc
Asst. Organizers:

Our Sponsors

We're looking for Sponsors!

Support a Meetup group while getting exposure to active, local members.