Giter Site home page Giter Site logo

gsh's Introduction

THE GUAN SHELL (GSH)

Introducion

Gsh is a toy software for operating system course, which is a good practice of comprehending system calls including fork() and exec(). It is not stable, but for educational and experimental use. Please use under your own risk.

Current version: 1.0.2 | ChangeLog

Travis CI: Build Status

Features

  • Bash-like prompt
  • Execute system commands
  • History and auto-completion

Installation

Gsh supports Linux and macOS with readline library.

Get library

macOS

macOS contains editline as an alias of readline, which is mostly compatible. Thus there is no need to install the library. But still note that they would behave differently on some rare circumstances. If you want to use GNU readline, please follow these steps:

$ brew install readline
$ export LD_FLAGS="-L/usr/local/opt/readline/lib"

Debian / Ubunru

$ sudo apt-get install libreadline-dev

RedHat / CentOS

$ sudo yum install readline-devel

Build from source

$ autoreconf --install --force
$ ./configure
$ make && make install

Get Started

$ gsh

And now you are in G-shell. The enviroment variables are inherited. After some try, you can exit with Ctrl+D (^D) or exit.

Further Usage

Add gsh to acceptable shells

Add the absolute path of gsh in /etc/shells. For example, add a new line:

# /etc/shells:

/bin/bash
/bin/sh
/usr/local/bin/gsh

Change default shell to gsh

Use chsh -s to change your default shell.

$ chsh -s /usr/local/bin/gsh

Enjoy

Open a new terminal and login, now you are using gsh.

Known Issues

  • Only cd and exit are implemented. Other build-in commands would be added in future versions.
  • Multi-line commands have not been supported so far.
  • History is in memory, not stored in files.
  • Enviroment variables has not been implemented.

TODO

  • enviroment variables
  • .gsh_history
  • ; (line separator)
  • | (pipe)
  • if
  • for

License

Copyright: 2017-2019, hguandl <[email protected]>

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

gsh's People

Contributors

hguandl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tangloner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.