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) |