Welcome to the GO VOLS! project. This repository contains simple programs in various programming languages that print "GO VOLS!" to the console. It's designed as a fun way for beginners to explore different programming languages and see how they can accomplish the same task.
This project includes programs in ten different programming languages:
- Bash: A shell and command language used in Unix-based systems.
- C: A general-purpose, procedural language known for its efficiency and low-level control.
- C++: An extension of C that adds object-oriented features.
- Fortran: One of the oldest high-level languages, still used in scientific computing.
- Go: A statically typed, compiled language designed for simplicity and efficiency.
- Java: A popular object-oriented language known for its "write once, run anywhere" philosophy.
- JavaScript (Deno): A versatile language primarily known for web development.
- Python: A popular, easy-to-learn language used in web development, data science, and AI.
- Rust: A systems programming language focused on safety and performance.
- SQL (PostgreSQL): A language for managing and querying relational databases.
Each language has its own directory with the necessary files to run a simple "GO VOLS!" program.
Here's how the project is organized:
go-vols/
├── bash/
│ ├── go_vols.sh
│ └── README.md
├── c/
│ ├── go_vols.c
│ └── README.md
├── cpp/
│ ├── go_vols.cpp
│ └── README.md
├── fortran/
│ ├── go_vols.f90
│ └── README.md
├── go/
│ ├── go_vols.go
│ └── README.md
├── java/
│ ├── GoVols.java
│ └── README.md
├── javascript/
│ ├── go_vols.js
│ └── README.md
├── python/
│ ├── go_vols.py
│ └── README.md
├── rust/
│ ├── src/
│ │ └── go_vols.rs
│ ├── Cargo.toml
│ └── README.md
├── sql/
│ ├── go_vols.sql
│ └── README.md
└── README.md (this file)
Each directory contains:
- The program file(s)
- A README.md with detailed instructions on how to run the program
If you're new to GitHub, here's how to get this project on your computer:
-
Install Git:
- Windows: Download from gitforwindows.org
- Mac: Install Xcode Command Line Tools or use Homebrew
- Linux: Use your distribution's package manager (e.g.,
sudo apt install git
on Ubuntu)
-
Open a terminal (Command Prompt or PowerShell on Windows, Terminal on Mac/Linux)
-
Navigate to where you want to store the project:
cd path/to/your/projects/folder
-
Clone the repository:
git clone https://github.com/jpotter80/go-vols.git
-
Enter the project directory:
cd go-vols
Each language directory has its own README.md with specific instructions. Generally, you'll need to:
- Install the necessary language or compiler
- Navigate to the language's directory
- Compile the program (if required)
- Run the program
Detailed instructions for each language are provided in their respective directories.
- If you're completely new to programming, start with Python or JavaScript.
- If you're interested in web development, try JavaScript.
- If you want to learn a systems programming language, check out C, C++, or Rust.
- If you're curious about databases, look at the SQL example.
- If you want to learn about shell scripting, try the Bash example.
- If you're interested in concurrent programming, explore Go.
- If you want to dive into object-oriented programming, Java or C++ are good choices.
- If you're interested in scientific computing, take a look at Fortran.
The command-line interface (CLI) is a powerful tool for interacting with your computer. While it may seem intimidating at first, becoming comfortable with the CLI can greatly enhance your productivity and understanding of computer systems.
A CLI is a text-based interface where you type commands to interact with your computer's operating system. Instead of using a graphical user interface (GUI) with windows and buttons, you enter text commands to perform tasks, manage files, and run programs.
- Command Prompt: This typically refers to the program or window where you type commands. It's the interface you see.
- Shell: This is the program that actually interprets and executes the commands you type. It's the "behind-the-scenes" engine of the CLI.
In practice, these terms are often used interchangeably, but understanding the distinction can be helpful.
Different operating systems use different shells by default:
-
Windows:
- Command Prompt (cmd.exe): The traditional Windows command interpreter.
- PowerShell: A more powerful shell with a different syntax and additional features.
-
macOS and Linux:
- Bash (Bourne Again Shell): The most common shell on Unix-based systems.
- Zsh (Z Shell): An extended version of Bash with many improvements, now the default on macOS.
- Fish: A user-friendly shell with auto-suggestions and web-based configuration.
-
Windows:
- Press
Win + R
, typecmd
orpowershell
, and press Enter. - Or search for "Command Prompt" or "PowerShell" in the Start menu.
- Press
-
macOS:
- Press
Cmd + Space
, type "Terminal", and press Enter.
- Press
-
Linux:
- Usually
Ctrl + Alt + T
or search for "Terminal" in your application menu.
- Usually
Here are some essential commands that work across most shells:
ls
(Linux/macOS) ordir
(Windows): List directory contentscd
: Change directorypwd
(Linux/macOS) orecho %cd%
(Windows): Print working directorymkdir
: Create a new directoryrm
(Linux/macOS) ordel
(Windows): Remove filescp
(Linux/macOS) orcopy
(Windows): Copy filesmv
(Linux/macOS) ormove
(Windows): Move or rename filescat
(Linux/macOS) ortype
(Windows): Display file contentsgrep
(Linux/macOS) orfindstr
(Windows): Search for patterns in filesman
(Linux/macOS) orhelp
(Windows): Display the manual for a command
- Efficiency: Many tasks can be performed faster via CLI than GUI.
- Automation: You can create scripts to automate repetitive tasks.
- Remote Access: Easily manage remote servers or computers.
- Developing: Many development tools are designed to be used via CLI.
- Don't be afraid to experiment. It's hard to cause serious damage with basic commands.
- Use the
--help
flag orman
command to learn about command options. - Use the up arrow to cycle through previous commands.
- Tab completion can save you a lot of typing - try pressing Tab while typing a command or file name.
When working with the command line, especially on Unix-based systems (Linux, macOS), you'll often encounter concepts related to permissions and administrative access. Understanding these is crucial for managing your system and running certain commands safely.
'Sudo' stands for "Superuser Do." It's a command that allows you to run programs with the security privileges of another user (by default, the superuser or root).
- Use
sudo
before a command to run it with elevated privileges. - You'll usually be prompted for your password when using sudo.
Example:
sudo apt update
Use sudo when:
- Installing software system-wide
- Modifying system files
- Running commands that require root access
Be cautious with sudo! It gives you the power to make significant changes to your system.
In Unix-like systems, every file and directory has permissions that determine who can read, write, or execute them.
Permissions are represented by letters:
- r: read
- w: write
- x: execute (for files) or access (for directories)
And they're set for three categories of users:
- Owner (u)
- Group (g)
- Others (o)
To view permissions, use the ls -l
command:
ls -l filename
You might see something like: -rw-r--r--
This means:
- The owner can read and write
- The group can read
- Others can read
Use the chmod
command to change permissions:
chmod u+x filename # Gives the owner execute permission
chmod go-w filename # Removes write permission for group and others
Files and directories also have owners and groups. Use chown
to change ownership:
sudo chown newowner filename
sudo chgrp newgroup filename
- Use sudo only when necessary.
- Be very careful when running commands with sudo, especially if you're not sure what they do.
- Keep your system's root password secure and don't share it.
- When changing permissions, be cautious not to make files or directories too open (e.g., world-writable).
PATH is an environment variable on your computer that tells the operating system where to look for executable programs. When you type a command in the terminal or command prompt, the system searches through the directories listed in PATH to find the program you want to run.
Many programming languages and tools need to be added to your PATH so that you can run them from any location in your terminal or command prompt. If a program isn't in your PATH, you'll need to type the full path to the program every time you want to use it, which is inconvenient.
- On Windows (Command Prompt):
echo %PATH%
- On macOS and Linux:
echo $PATH
- Search for "Environment Variables" in the Start menu and select "Edit the system environment variables"
- Click "Environment Variables"
- Under "System variables", find and select "Path", then click "Edit"
- Click "New" and add the full path to the directory you want to add
- Click "OK" on all windows to save the changes
- Restart any open Command Prompt windows for the changes to take effect
- Open your shell configuration file (e.g.,
~/.bash_profile
,~/.bashrc
, or~/.zshrc
) in a text editor - Add the following line at the end of the file, replacing
/path/to/directory
with the actual path:export PATH="/path/to/directory:$PATH"
- Save the file and close the editor
- Apply the changes by running:
source ~/.bash_profile # or ~/.bashrc, or ~/.zshrc
Here are some common situations where you might need to add something to your PATH:
- Installing a new programming language (e.g., Python, Go)
- Installing development tools (e.g., Git, Node.js)
- Using command-line tools that come with an application
If you've added a directory to your PATH but still can't run the program, try these steps:
- Make sure you've restarted your terminal or command prompt
- Double-check that the path you added is correct
- Ensure that the program or script you're trying to run has the correct permissions (especially on macOS and Linux)
Remember, modifying your PATH is a powerful tool, but be careful not to remove existing entries accidentally. Always add new directories to the end of your PATH unless you have a specific reason to do otherwise.
This repository contains only source code and documentation. Executables and compiled files are not included in the repository for the following reasons:
- They are platform-specific and can be easily generated from the source code.
- Including them would unnecessarily increase the repository size.
- They can cause conflicts in version control, especially across different platforms.
When you run the programs, especially for compiled languages like C, C++, Fortran, Go, and Rust, executables or compiled files may be generated on your local machine. These files are specific to your system and should not be committed to the repository. Note that some executables, particularly those generated by C, C++, and Fortran compilers on Unix-like systems, may not have file extensions (e.g., they might simply be named go_vols
).
The .gitignore
file in this repository is set up to exclude these generated files from version control, including executables both with and without file extensions.
Feel free to add implementations in other programming languages! To contribute:
- Create a new directory for the language.
- Add the source code file(s) and any necessary project files.
- Include a README.md with detailed, beginner-friendly instructions.
- Update this main README.md with information about the new language.
This project is maintained by jpotter80. It's inspired by the spirit of the University of Tennessee Volunteers sports teams.
Go Vols!