Script does not work after installing Linux Mint
I have recently installed Linux Mint Julia on my computer. I have restored all the stuff from the Pardus. Everything is working fine except the following script.
Code:
read -p "Unlock the folder now (y/n)?"
[ "$REPLY" == "y" ] || exit
And it displays the following error message on the screen.
Code:
read: 3: arg count
[: 4: unexpected operator
Well above mentioned script is working fine on the Pardus. Please let me know what is wrong on the above mention script? Please let me know if you are having any solution with you. I will appreciate for your reply.
Re: Script does not work after installing Linux Mint
Well above mentioned script is working properly on my system. I want to know whether you are using bash on your system. Also I want to know whether you have overridden the read command. Well I also want to know that what happens when you type help read on the terminal. I think it should work if you a have installed bash on your system. If all the above instruction does not work for you then you should run the ‘which read’ command on the terminal to check the path of the executed file. I hope it will help you to solve your problem.
Re: Script does not work after installing Linux Mint
I hope below mentioned instructions will help you out to solve the problem. Well I think you have to delete the link /bin/sh from your computer. I think you have to install bash using the package manager on your computer. Now you have to copy paste following piece of the code on the terminal. Above mentioned code will set up you default shell to bash. Please let me know about your experience so other users on this forum can learn from it.
Re: Script does not work after installing Linux Mint
Well I think there is a permission issue with the file. I want to know whether you have tried to run the script by log in into terminal as a root. Also I want to know whether there is correct permission is assigned to the file. You can check the permission by right clicking on the file. Well I also wanted to know whether you have run the script using sudo command. Finally I want to tell you if the above mentioned steps are not working then I think you have to change the permission of the script file .You can use chmod command to change the file permission.
Re: Script does not work after installing Linux Mint
Well I got the root cause of the problem. I was running sh script instead of bash script. I do not why it was working on the Pardus. Now I have changed sh script with bash and now I can run the script on the Linux Mint. Well I want to say thanks to all of you for your support and understanding. I really want to appreciate your efforts that you have put in. Thanks a lot for helping in this situation. Appreciated!