O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Differing Features

The following table is a sampling of features that differ between the two shells:

bash

tcsh

Meaning/Action

$

%

Default prompt.

>|

>!

Force redirection.

>>!

Force append.

var=val

set var=val

Variable assignment.

export var=val

setenv var val

Set environment variable.

$#

$#argv

Number of arguments.

$( command ), ``

``

Command substitution.

. file, source file

source file

Execute commands in file.

done

end

End a loop statement.

esac

endsw

End case or switch.

for/do

foreach

Loop through variables.

if [ $i -eq 5 ]

if ($i= =5)

Sample if statement.

fi

endif

End if statement.

ulimit

limit

Set resource limits.

read

$<

Read from terminal.

readonly

set -r

Make a variable read-only.

Tab Tab

Show possible completions.

trap 2

onintr

Ignore interrupts.

until/do

until

Begin until loop.

while/do

while

Begin while loop.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required