Gonix 用Go语言编写*nix工具 Gonix

polaris2015-05-09 04:13:27 • 4408 次点击    
这是一个分享于 2015-05-09 04:13:27 的项目,其中的信息可能已经有所发展或是发生改变。

gonix

Clones of the *nix tools written in go

Status

If a program is marked complete, then most/all the standard features are implemented.

  • basename [works]
  • cat [works]
  • cp [works, very incomplete]
  • dirname [complete]
  • echo [works]
  • false [complete]
  • head [works]
  • mkdir [works]
  • nl [works]
  • pwd [works]
  • seq [works]
  • sleep [complete]
  • tail [works]
  • tee [complete]
  • touch [works]
  • true [complete]
  • xxd [works]
  • yes [complete]

Unimplemented:

  • bc
  • dc
  • ed
  • ls
  • more
  • rm

Bugs

Many tools do not exist and many features are not implemented. I used "flag" to do the flag-parsing, it is a little strict (ie. no combining flags like -xyz instead of -x -y -z).

Building

To keep the binary sizes small (around 20-30kb each, on my PC) I use the gccgo compiler, so you need to have that installed.

Build the project with the build script:

$ sh build.sh

It will compile each program and the binaries will be placed in the same directory.

TODO: Write a Makefile.

Running

As long as you are in the same directory as the compiled program, you can run it like so:

./x

Where x refers to the name of the program

WARNING: Keep the programs in a directory NOT in your $PATH or they may end up being run instead of your system's commands.

Latest commit to the undefined branch on unknown
Download as zip
授权协议:
GPL
开发语言:
Golang 查看源码»
操作系统:
Unix
4408 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传