Article Preview
Buy Now
| PDF: |
Beyond the Limits
Wrap it up!
Using RB's Shell class to control UNIX.
Issue: 1.2 (October/November 2002)
Author: Didier Barbas
Article Description: No description available.
Article Length (in bytes): 10,067
Starting Page Number: 46
RBD Number: 1124
Resource File(s):
1124.sit Updated: Friday, October 17, 2003 at 12:19 PM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Today, I will take you down the path of RB's shell classes for Unix/OS X. We will build a shell wrapper for the zip Unix tool. Adding other tools should be quite straightforward, and after reading this you should be able to unlock Unix's power through RB's shell classes.
Shell classes are available for Unix and DOS, meaning you can use them for OS X and Windows builds. As a stubborn Frenchman, I'll skip the subject of DOS shell classes since I don't care much about WinTel boxes. However, not everyone has the leisure to stay away from Windows, and building a shell class for DOS should be quite easy once you get the general principle. Have fun.
What is a Unix Shell?
A shell is a programm that accepts user input, sorts out the mess with more or less success, and passes it on to the kernel. There are several flavors, the one launched by default on the Terminal application being tcsh, an improved version of the C shell. The shell has no GUI, and shell commands should not rely on interactive user input. The most "natural" way of doing things is to pass all arguments on the command line. You can also route a command's output into another command, through a "pipe." For instance, when you list a directory's content with ls -al, however big your screen may be you will run into a directory that has way too many files, and you end up seeing only the last ones. To avoid that, you route the output of ls to more (or less, which is even better): ls -al | less
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|










