Questions Concepts
GitHub icon

Bash

Bash - Programming language

< >

Bash is an open source programming language created in 1989 by Brian Fox.

#41on PLDB 34Years Old 2mRepos

Try now: Riju · TIO

Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. First released in 1989, it has been distributed widely as the default login shell for most Linux distributions and Apple's macOS (formerly OS X). A version is also available for Windows 10. Read more on Wikipedia...


Example from Riju:
echo "Hello, world!"
Example from hello-world:
#!/bin/sh echo "Hello World"
Example from Linguist:
#!/bin/sh echo "sh"
Example from Wikipedia:
cd "$SOMEWHERE" && ./do_something || echo "An error occurred" >&2
if then do else elif while until for in esac fi fin fil done exit set unset export function

Language features

Feature Supported Token Example
Conditionals
Functions
While Loops
File Imports
source ./bash.sh
Assignment =
FOO="bar"
Print() Debugging echo
echo "Hello World"
Pipes
echo "Hello world" > output.txt
Here Document
cat <
Integers
PLDB=80766866
Strings "
"Hello world"
Line Comments #
# A comment
Comments
# A comment
Variable Substitution Syntax
STR="Hello World!"
echo $STR
Sets X
MultiLine Comments X
Semantic Indentation X
Units of Measure X

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Traffic · Traffic Today · Day 305 · feedback@pldb.com · Logout