Reference Tables

This chapter contains tables of syntax elements for all three shells and examples of shell scripts.

Environment Files

Description Bourne Korn C
Read at login. .profile .profile .login
Read at invocation of shell.  Any file specified in .profile with ENV=file. By convention, file is usually .kshrc .cshrc

First Line of Script

Shell Syntax
Bourne #!/bin/sh
Korn #!/bin/ksh
C #!/bin/csh -f

Korn Shell Path Operators

Operator Description
${variable# pattern} Delete the shortest part at the beginning of the variable that matches the pattern and return the rest.
${variable## pattern} Delete the longest part at the beginning of the variable that matches the pattern and return the rest.
${variable% pattern} Delete the shortest part at ...

Get Solaris™ 8 Advanced System Administrator's Guide, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.