Imported from ../bash-1.14.7.tar.gz.
[platform/upstream/bash.git] / examples / functions / csh-compat
1 # C-shell compatabilty package.
2 # setenv VAR VALUE
3 function setenv () {
4   export $1="$2"
5 }
6
7 function unsetenv () {
8   unset $1
9 }
10
11 function alias () {
12   local name=$1
13   shift
14   local value="$*"
15
16   if [ "$name" = "" ]; then
17     builtin alias
18   elif [ "$value" = "" ]; then
19     builtin alias $name
20   else
21     builtin alias $name="$value"
22   fi
23 }
24
25 # Can't write foreach yet.  Need pattern matching, and a few extras.
26 function foreach () {
27 echo 'Can'\''t do `foreach'\'' yet.  Type "help for".'
28 }
29
30 # Make this work like csh's.  Special case "term" and "path".
31 #set () {
32 #}
33
34 chdir () {
35   builtin cd $*
36  }