O'Reilly logo

Mac OS X Panther in a Nutshell, 2nd Edition by Jason McIntosh, Chuck Toporek, Chris Stone

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

Table 19-2 is a sampling of features that differ between the two shells.

Table 19-2. Differences between the bash and tcsh shells

Meaning/action

bash

tcsh

Default prompt

$

%

Force redirection

>|

>!

Force append

>>!

Variable assignment

var = val

set var = val

Set environment variable

export var = val

setenv var val

Command substitution

$( command ),``

``

Number of arguments

$#

$#argv

Execute commands in file

. file

source file

End a loop statement

done

end

End case or switch

esac

endsw

Loop through variables

for/do

foreach

Sample if statement

if [$i -eq 5]

if ($i==5)

End if statement

fi

endif

Set resource limits

ulimit

limit

Read from terminal

read

$<

Make a variable read-only

readonly

set -r

Show possible completions

Tab Tab

Ignore interrupts

trap 2

onintr

Begin until loop

until/do

until

Begin while loop

while/do

while

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