0% found this document useful (0 votes)
121 views5 pages

Bourne Shell and C Shell Difference 2

This document compares common commands and features between the bash and csh shells. It shows that bash uses '$' for default prompts and command substitution, while csh uses '%' and backticks. It also lists differences in redirection, variable assignment, environment variables, command history, condition testing, and looping between the two shells.

Uploaded by

Girish Sahare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views5 pages

Bourne Shell and C Shell Difference 2

This document compares common commands and features between the bash and csh shells. It shows that bash uses '$' for default prompts and command substitution, while csh uses '%' and backticks. It also lists differences in redirection, variable assignment, environment variables, command history, condition testing, and looping between the two shells.

Uploaded by

Girish Sahare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Meaning/Action bash (Bourne Shell) csh (C-Shell)

Default user $ %
prompt
Force redirection >| >!
Redirect stdout and &> file or > file 2>&1 >& file
stderr to file
Expand elements {} {}
in list
Substitute output `command` or $(command) `command`
of enclosed
command
Home directory $HOME $home
Home directory ~ ~
symbol
Access directory ~+, ~-, dirs =-, =N
stack
Variable VAR=value set var=value
assignment
Set environment export VAR=value setenv var val
variable
More than 9 ${nnnn}
arguments can be
referenced
All arguments as "$@"
separate words
Number of $# $#argv
arguments
Exit status of the $? $status
most recently
executed command

PID of most $!
recently
backgrounded
process
Current options $-
Read commands in source file or . file source file
file
Name x stands for alias x='y' alias x y
command y
Choose case switch or case
alternatives
End a loop done end
statement
End case or switch esac endsw
Exit with a status exit n exit (expr)
Loop through for/do foreach
variables
Ignore substitution set -f, set -o noglob
characters for nullglob|dotglob|nocaseglob|noglob
filename
generation
Display hashed hash hashstat
commands
(tracked aliases)
Remember hash cmds rehash
command locations
Forget command hash -r unhash
locations
List previous history history
commands
Redo previous ArrowUp+Enter or !! !!
command
Redo last !str !str
command that
starts with "str"
Replace "x" with !cmd:s/x/y/ !cmd:s/x/y/
"y" in most recent
command starting
with "cmd", then
execute.
Sample condition if [ $i -eq 5 ] if ($i==5)
test
End if statement fi endif
Set resource limits ulimit limit
Print working pwd dirs
directory
Read from terminal read $<
Ignore interrupts trap 2 onintr
Remove aliases unalias unalias
Begin while loop while/do While

You might also like