[memo] Ubuntu : ctrl-L not work , 按 ctrl-L 不會清除螢幕 , TERM , .bashrc .profile 問題 , Ubuntu 8.04.4 LTS

這個版本的 .bashrc 不 work , 要用 .profile
lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.4 LTS
Release: 8.04
Codename: hardy
—-
$ cat .profile
export EDITOR=vi
export PATH=/sbin:$PATH
export LANG=
export TERM=xterm
export http_proxy=
export https_proxy=

unix shell programming / sh / csh syntax

Shell script syntax

Bourne shell (sh) syntax samples

test:
[ number -lt|-le|-eq|-ne|-ge|-gt number ]
[ string = != string ]

if [ test ]
then
   commands
elif [ test ]
   commands
else
   commands
fi

for var in item1 item2 item3
do
  commands
done

while test
do
  commands
done

case expression in
  case1)         commands ;;
  case2|case3)   commands ;;
  *)             default-commands ;;
esac


# How to read an input file into shell variables:
while read variable1 variable2
do
  ...
done < $input_file

# How to redirect stdout/stderr
echo something 1>&2
echo something 2>&1

# How to throw out stdout and stderr
some_command > /dev/null 2>&1

# Shell functions:
func () {
	echo $1 $2 $3
}
func a b c


C shell (csh) syntax samples

test:
( expression ==|!=|>>|<< expression )

if ( test ) command

if ( test ) then
   commands
else if ( test ) then
   commands
else
   commands
end if

foreach var ( list list list )
  commands
end

while condition
   commands
end

# How to throw out stdout and stderr
some_command >& /dev/null

另一個

#!/bin/sh
count=0
while [ $count -lt 5 ]
do
  count=`expr $count + 1`
  echo $count
done