Shell++ is a programming language that aims to bring functionalities from modern languages, such as ease of manipulation of data structures, object-oriented programming, functional programming and others including Shell Script.
Installation
Clone the repository recursively:
git clone --recurse-submodules -j8 https://github.com/alexst07/shell-plus-plus
After cloned, we realized that it uses CMake, if you export the CXX
variable, you may be able to use another compiler, but you will need: CMake, GCC and GNU Make.
Some distros offer the package with essential tools for building binaries, if you use Debian, Ubuntu, Mint and simlares, just install the package: build-essentials. If you use Gentoo, you don’t need to install anything.
# you can change the compiler with this command:
export CXX=$(which clang++)
mkdir build && cd build
cmake ..
make
After building the binary, it can be found at: ./shell/shpp
. You can run one:
sudo make install
Remembering that you can also execute the binary directly.
Basic usage example:
Hello, World!
cat << EOF > hello.sh
print("Hello, Shell++")
EOF
shpp hello.sh
And among several other forms of use that we can see here in the project’s repository documentation.
Alternatives to Shell++:
Among other options:
- http://hipersayanx.blogspot.com/2012/12/object-oriented-programming-in-bash.html
- https://developpaper.com/object-oriented-shell-script/
- http://blog.fpmurphy.com/2010/05/ksh93-using-types-to-create-object-orientated-scripts.html
Watch the video
The video is in Brazilian Portuguese, but you can use automatic translation from Youtube or even just watch the procedures, because the commands are universal
Add our feed: https://en.terminalroot.com.br/feed to:
Feedly