另外,TAB键在这里有何妙用啊?
源程序代码
代码: 全选
#!/bin/bash
# menu shell script. samli 2004.4.19
until
echo "List Directory..........1"
echo "Change Directory........2"
echo "Edit File...............3"
echo "Remove File.............4"
echo "Exit Menu...............5"
read choice
test $choice = 5
do
case $choice in
1) ls;;
2) echo "enter target directory:"
read dir
cd $dir
;;
3) echo "enter file name:"
read file
vi $file
;;
4) echo "enter file name:"
read file
rm $file
;;
5) echo "Goodbye"
;;
*) echo "illegal option, please input again."
esac
done
没学diff啊 根据我的理解弄得 也不知道是不是你们说的diff啊
代码: 全选
l-think@ubuntu:~$ diff test3 test4
2,31c2,31
< # menu shell script. samli 2004.4.19
< until
< echo "List Directory..........1"
< echo "Change Directory........2"
< echo "Edit File...............3"
< echo "Remove File.............4"
< echo "Exit Menu...............5"
<
< read choice
< test $choice = 5
< do
< case $choice in
< 1) ls;;
< 2) echo "enter target directory:"
< read dir
< cd $dir
< ;;
< 3) echo "enter file name:"
< read file
< vi $file
< ;;
< 4) echo "enter file name:"
< read file
< rm $file
< ;;
< 5) echo "Goodbye"
< ;;
< *) echo "illegal option, please input again."
< esac
< done
---
> # menu shell script. samli 2004.4.19
> until
> echo "List Directory..........1"
> echo "Change Directory........2"
> echo "Edit File...............3"
> echo "Remove File.............4"
> echo "Exit Menu...............5"
>
> read choice
> test $choice = 5
> do
> case $choice in
> 1) ls;;
> 2) echo "enter target directory:"
> read dir
> cd $dir
> ;;
> 3) echo "enter file name:"
> read file
> vi $file
> ;;
> 4) echo "enter file name:"
> read file
> rm $file
> ;;
> 5) echo "Goodbye"
> ;;
> *) echo "illegal option, please input again."
> esac
> done
l-think@ubuntu:~$