#新建一个脚本文件for.sh,把如下内容放进去.
#并用sh fro.sh运行即可
#已在ubuntu 9.10下成功运行.
#!/usr/bin/sh
echo "Hello "`whoami`
date
##
key=-1
while [ $key -ne 0 ]
do
echo 'input key:[0-10]'
read key
if [ $key -eq 0 ]
then
echo "quit!"
elif [ $key -eq 1 ]
then
echo 'the path:'`pwd`
elif [ $key -eq 2 ]
then
echo 'the file list:'
echo`ls`
elif [ $key -eq 3 ]
then
echo 'cd other path,plz input:'
read newpath
cd $newpath
elif [ $key -eq 4 ]
then
echo 'find the file,plz input:'
read filename
find ./ -name $filename
elif [ $key -eq 5 ]
then
echo 'creaet a file,plz input:'
read filename
touch $filename
elif [ $key -eq 6 ]
then
echo 'cp the file,plz input path:'
read path
cp $filename $path
elif [ $key -eq 7 ]
then
echo 'mv the file,plz input path:'
read path
mv $filename $path
elif [ $key -eq 8 ]
then
echo 'rm the file,plz input filename:'
read filename
rm $filename
elif [ $key -eq 9 ]
then
echo 'create a path,plz input path:'
read path
mkdir -p $path
elif [ $key -eq 10 ]
then
echo 'rm a path,it will be dangerours!,plz input path:'
read path
rm -r $path
elif [ $key -eq 11 ]
then
echo 'df -k:'
df -k
elif [ $key -eq 12 ]
then
echo 'chmod the file,plz input filename:'
chmod 777 $filename
elif [ $key -eq 13 ]
then
echo 'if u want the command detail, plz input( man [commandname]).'
else
echo 'no this num!'
fi
done
#答案补充
#你可以通过三种方法获得此种环境.
正如你问题中描述中所提到的,它是UNIX/LINUX的一种SHELL环境.
所以你只要得到UNIX或仿真UNIX环境即可.
1 Ubuntu http://www.ubuntu.org.cn/getubuntu/download/ 建议安装虚拟机再安装些系统.
2 仿真UNIX:cygwin
3 在线的UNIX环境 www.unix-center.com有.
==
使用以上环境建议安装一个secureCrt的WINDOWS客户端,因为大多数用户还是在WINDOWS进行工作.
宛如清单列表一般的入门级shell程序
lz你可不可以不要这么懒啊