Sash
From iPodLinux
The Sash Shell - A Command Line Interface
Contents |
Modified 24/Nov/2005 (fixed some memory which wasn't being free'd).
Download: Sash.tgz - (already included in the lates userland)
Starting the sash Shell
An unmodified iPod Linux (as installed by the GUI-installers for Mac OS X or Windows) boots straight into the podzilla GUI application. You can enter the sash shell in the following way: From podzilla, start the File Browser. Navigate to the "/bin" directory. Scroll down to the program "sh" (actually this is a link to the sash executable). Start it by pressing the center button.
Hint: putting "false" (without the quotes) at the end of your /etc/rc file will launch sash as is described here.
Entering Commands
The prompt shows your current dir. When sash was entered as above, the initial dir is /sbin. As an example enter the command "cd .." to change to the root dir "/" as follows:
Choose a character by using the scroll wheel. All available characters show up: lower case letters, upper case letters, numbers and some other ascii chars. When the correct char is displayed at the insertion point (cursor position), in our example the lower case "c", press the Next button. The char will be accepted and the cursor will be advanced. As the default for the next char a second "c" is displayed. (The default is always the same char as the last one.) But we want a "d", so by carefully moving the scroll wheel a very small amount change the "c" into a "d". Commit this "d" by pressing again the Next button. A second "d" appears. Change it by scrolling into a space. You find the space just before the "a". To complete the example, we need two dots. Enter a dot. This time the second dot appearing as default is okay, we just want it. So do not change it but press enter now. Enter is the "Play/Pause" button. The command is executed and the working dir is now "/".
Commands and filenames can be tab-completed by hitting f w d and a short menu of preset commands are available by hitting menu (See the README for more details).
In order to feel at home in Linux we can go on making a home directory (iPod Linux arrives without one). Enter the command "mkdir home" now, than enter "cd home". Here we can create a new file named "test" by entering the command "touch test".
Using the viP Text Editor
When you want to edit the contents of a file "test", enter the command "viP test". viP is the text editor of iPod Linux. (If "test" exists already, it will be opened for editing, otherwise a file of that name will be created.)
As its grandfather vi, viP makes heavy use of modes. When started up viP is in "insert" mode. In "insert" mode you can enter text (using the scroll wheel and the Next button, just like in sash). This text will be inserted at the cursor position, i.e. already existing will not be overwritten but shifted behind.
When ready with text input you have to change to the command mode. Press the Menu button once to change to the command mode. The cursor jumps to the last line of the screen and awaits for a typed command. Instead of typing a command it is usually easier to press Menu again. Now you have a scrollable menu of available commands in that last line of the screen. Available commands include :insert, :move, :save, :quit. You execute a command by pressing the enter button (Play/Pause).
- insert brings you into the "insert" mode, described above
- save saves the current state of the file to disk
- quit leaves the editor (and returns to sash)
- move switches to the "move" mode
In "move" mode the cursor is back in the text area. You can now move around in the open file. Turning the scroll wheel either moves horizontally inside a line from char to char, or vertically from line to line. You switch between these two submodes by pressing the center button.
Other examples
Other shell command examples (besides the already mentioned cd, ls, mkdir, viP, touch) include:
- ps - list of running processes
- uptime - elapsed time since booting into Linux
- exit - leave the shell
and others, found in the /bin directory.
Leaving the Shell
While in the shell you can return to the podzilla GUI by entering the command "exit" or by simply pressing the Menu button.
Example with Sreenshots
There is an external site containing 19 screenshots about sash and viP usage. The text and examples are similar to those presented here.