Chinaunix首页 | 论坛 | 博客
  • 博客访问: 363713
  • 博文数量: 168
  • 博客积分: 6895
  • 博客等级: 准将
  • 技术积分: 1726
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 23:01
文章分类

全部博文(168)

文章存档

2011年(6)

2010年(162)

我的朋友

分类: LINUX

2010-12-03 22:13:45

   When you use shell to manage your computer you will come across some problems. I am the same. Following is my issue :)(Attention: under ubuntu 9.04)

The shell script code:
#shell script for our process FS.
#Programmer's name: XYKERNELGROUP(xiyoulinuxkernelgroup@googlegroups.com).
#Time and Place: 2010, 12, 1.
#introduction: use this shell to establish a file and print all the kernel processes into it :)

#!/bin/bash
echo    "We will go for kernel process :)"
echo    "Enter y/n to start it!"
read -p "Enter it(y/n): " yn

if    [ "$yn" == "y" ] || [ "$yn" == "Y" ]; then
    echo    "Ok, continue"
    touch    process
    make
    dmesg -c
    sudo insmod xylgkgfs.ko
    make clean
    rm -f Module.markers
    rm -f modules.order
    dmesg > process
   
    exit    0
       
elif    [ "$yn" == "n" ] || [ "$yn" == "N" ]; then
    echo    "Good bye :)"
   
    exit    0
else
    echo    "Enter y or n please!"
   
    exit    0
fi

jiawei@jiawei-desktop:~/Desktop/xylgkgfs$ sh run.sh
Enter y/n to start it!y
[: 14: y: unexpected operator
[: 14: y: unexpected operator
[: 18: y: unexpected operator
[: 18: y: unexpected operator

How to solve it?
1, You should know shell attach to dash by default then dash is different from bash. So the error happened :) The solution is we can correct it for bash.
2, Do the command "sudo dpkg-reconfigure dash"
3, It will come a graphical interface and choose "No".
4, Do you following things.

Any discussions is welcomed(harryxiyou@gmail.com).  

阅读(659) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~