6.4. 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.
|
| | | 6.3. Common Features | | 7. bash: The Bourne-Again Shell |
Copyright © 2003 O'Reilly & Associates. All rights reserved.
|
|