sed
A Bash Script to Convert brainfuck Code Into C
Brainfuck is a minimalist Turing Complete language. You can read about it here.
The following bash script takes a file with brainfuck code (legal characters are >< ,.+-[] any other characters are ignored), and generates its C equivalent code, which can then be compiled with a C compiler and executed.
The output of this script lacks indentation. If you insist on having the C code indented you can achieve this by passing the output through a pipe to “indent”, “astyle” or similar programs.
The script should be called in the following way:
./bf.sh code.bf > code.c
Where code.bf is the file containing the brainfuck code.
Sed and AWK – A quick reference
Sed (Stream Editor) and AWK (First letters of the surnames of its authors) are very powerful *nix tools for manipulating strings and text files. They combine the power of regular expressions with the power of a programming language for this aim.
Here are two quick references for doing many operations with a one-line code of sed and AWK. (Both are by the same author – Eric Perment):
› Continue reading
About Me
Tags
My Twitter
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Science
- Security
- Shell Scripts
- Short Posts
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)

Me @ Social Media