| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Get control of your email attachments. Connect all your Gmail accounts and in less than 2 minutes, Dokkio will automatically organize your file attachments. You can also connect Dokkio to Drive, Dropbox, and Slack. Sign up for free.

View
 

Sash

Page history last edited by PBworks 12 years, 2 months ago

Sash

Stand-alone shell (sash) is a Unix shell used for booting up the MG-35/45, and as the default command interpreter.

 

Version: 3.7-mg

Status: Done

 



 

Boot (init)

Sash first runs as the boot manager (init), checking for (and executing if found):

  • ${HOME}/.aliasrc (${HOME} defaults to '/' in kernel)
  • /etc/sashrc

After it finishes running sashrc, it displays a command prompt on the console (serial port in developer kernel).

 

Subshell (sh, sash)

Whenever sash starts as a subshell, it checks for (and executes if found):

  • ${HOME}/.aliasrc (${HOME} defaults to '/usr/home' in /etc/sashrc)

 

Usage


sash [ { -c command | -f scriptfile } ] [ -p prompt ] [-q] [-a]

Options:

    -c command
        Execute command, and exit.  If command contains spaces or
        other shell special characters, you should enclose it in
        "quotes" and escape any special characters.

    -f scriptfile
        Load commands from scriptfile and execute them.

    -p prompt
        Set the interactive shell prompt string.

    -q  Be quiet.
    
    -a  Alias all built-in commands.
   

 

Shell language

The sash shell has been extended to include support for:

  • ${VARNAME} environment variable expansion
  • if/elif/else/fi conditional (script only)

 

if [ <condition> ]

then

some command

elif [ <condition> ]

some other command

else

a third command

fi

  • while/do/done conditional loop (script only)

 

while [ <condition> ]

do

some command

some other command

done

 

Shell commands

alias      [name [command]]
aliasall   
-ar        [txp]v arFileName fileName ...
-cat       fileName ...
cd         [dirName]
-chgrp     gid fileName ...
-chmod     mode fileName ...
-chown     uid fileName ...
-clear     
-cmp       fileName1 fileName2
-cp        srcName ... destName
-dd        if=name of=name [bs=n] [count=n] [skip=n] [seek=n]
-dmesg     
-echo      [args] ...
-ed        [fileName]
exec       fileName [args]
exit       
-file      fileName ...
-find      dirName [-xdev] [-type chars] [-name pattern] [-size minSize]
-grep      [-in] word fileName ...
help       [word]
-kill      [-sig] pid ...
-ln        [-s] srcName ... destName
-ls        [-lidFC] fileName ...
-mkdir     dirName ...
-mknod     fileName type major minor
-more      fileName ...
-mount     [-t type] [-r] [-s] [-e] [-m] devName dirName
-mv        srcName ... destName
-pipeenv   VARNAME program [ | program ] ...
-pivotroot newroot oldroot
-printenv  [name]
prompt     string
-ps        
-pwd       
quit       
-rm        fileName ...
-rmdir     dirName ...
setenv     name value
sleep      seconds
source     fileName
.          fileName
-sum       fileName ...
-sync      
-tar       [cxtv]f tarFileName fileName ...
test       EXPRESSION
[          EXPRESSION
-touch     fileName ...
umask      [mask]
-umount    fileName
unalias    name
-where     program

 

History

[John, 2008-03]

  • Re-wrote init portions
  • Added command line editing, command history in ${HOME}/.sash_history
  • Added SHELL parameters in ${VAR} format
  • Added "test"/"[" expression evaluation
  • Added "if/elif/else" and "while/break/continue" block commands
  • Might still need shell arithmetic (bigbox includes 'expr')
  • Added Zombie process reaper
  • Added pipeenv builtin pipeenv COUNTER expr ${COUNTER} + 1
  • Added LINES and COLUMNS terminal size auto-updating
  • Added -pivotroot built-in to sash. Tested working with new kernel.
  • Added "-" (stdin) stream to -grep, -cat

Comments (0)

You don't have permission to comment on this page.