Results 1 to 4 of 4
I entered the following commands one by one and worked very fine in RedHat.
service squid stop
rpm -e squid
rpm -ivh /root/squid-2.4.STABLE6-1.7.2.i386.rpm
cd /etc/squid
cp squid.conf.rpmsave squid.conf
service squid ...
- 01-25-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 3
A script worked improperly
I entered the following commands one by one and worked very fine in RedHat.
service squid stop
rpm -e squid
rpm -ivh /root/squid-2.4.STABLE6-1.7.2.i386.rpm
cd /etc/squid
cp squid.conf.rpmsave squid.conf
service squid start
When I saved them as a script, it didn't work properly.
(add #!/bin/sh and chmod 755)
Can anyone tell me how to solve this problem?
Thank you very much!
- 01-25-2009 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Need more information.
What command did you use to run the script.
What was the error message.
Post the script
- 01-25-2009 #3Just Joined!
- Join Date
- Jan 2009
- Posts
- 3
I saved the following commands
#!/bin/bash
service squid stop
rpm -e squid
rpm -ivh /root/squid-2.4.STABLE6-1.7.2.i386.rpm
cd /etc/squid
cp squid.conf.rpmsave squid.conf
service squid start
into a file called "reborn" and chmod it to 755.
I thought that as I typed "reborn" and the system showed me "command not found".
But I typed "./reborn" and it worked pretty good.
I am a Linux beginner.
Actually, I don't know the difference between "bash" and "sh".
Thanks for your helps.
- 01-25-2009 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
Forgetting the './' in front of the script is a common mistake by beginners. The './' means to look for the script in the current directory. If you forget the './' Linux looks for the script in the directories listed in the PATH variable. You can see that with:
In Linux "bash" and "sh" are the same thing. /bin/sh is what's called a symbolic link that points to /bin/bash.Code:echo $PATH


Reply With Quote
