Results 1 to 8 of 8
Hi,
I am runnin a CentOS 4.4 Server.
I try to launch very basic shell script that I created. The purpose of this script is to laucnh several commands.
Unfortunaltely ...
- 02-19-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 4
Prompt prevents me from launching script
Hi,
I am runnin a CentOS 4.4 Server.
I try to launch very basic shell script that I created. The purpose of this script is to laucnh several commands.
Unfortunaltely it fails and the errors that I have are due to the fact that prompt appears at every command (even if I don't see it) and shrinks all my commands in my script.
Content of my script :
cd /usr/local
tar xvf test.tat
My prompt looks like this [root@localhot]
What configuration do I miss ?
Tks,
C.
- 02-19-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
I don't know how did you reach that conclussion. But the prompt has nothing to do with your prompt.
Actually, you probably mean "test.tar", instead of "test.tat". Besides that, you need to be aware that users usually don't have write permissions under /usr, so, the extraction on that dir will fail unless you are root.
If you have errors, paste the exact contents of your script, and the errors that appears in the terminal when launching it.
EDIT: corrected "prompt" instead of "script". :P
- 02-19-2008 #3Just Joined!
- Join Date
- Feb 2008
- Posts
- 4
Hi,
Thanks for your help. I will try to explain better:
Here is the content of my script called "step1-Install_Tomcat.sh" :
gunzip apache-tomcat-6.0.14.tar.gz
When I try to launch the script by the following command, here is the result I have:
[root@localhost Colt54EW214]# ./step1-Install_Tomcat.sh
.gz: No such file or directoryar.gz
tar: apache-tomcat-6.0.14.tar\r: ne peut open: Aucun fichier ou répertoire de ce type
If you compare the lenght of my prompt, you will see that it stops at the same point of the ....tar.gz of the command in my script.
Thanks,
C.
- 02-19-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Are you sure this tarball is not corrupt?
Try a little test:
If that works well, then your gzip files are corrupted. I have never seem a similar error. But the prompt has really nothing to do with the internal behaviour or the programs. If the tarballs are not corrupted, then something must be seriously screwed in your basic system stuff.Code:mkdir ~/temp cd ~/temp tar -cvzf test.tar.gz /etc/init.d/* tar -xvzf test.tar.gz
This is a bit strange.
- 02-19-2008 #5Just Joined!
- Join Date
- Feb 2008
- Posts
- 4
Yes, the tarball is fine, I can extract it manually without any problem.
- 02-19-2008 #6Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
- 02-19-2008 #7Does this command have any spaces in it, or does it spangunzip apache-tomcat-6.0.14.tar.gz
lines? The error says it can't find "ar.gz"
Try retyping this part of the script. Maybe there's
hidden corruption in the text, like a stray carriage return.
- 02-19-2008 #8Just Joined!
- Join Date
- Feb 2008
- Posts
- 4
OK, problem is solved.
My script file was in DOS format. I run the dos2unix command on it and the script runs perfectly now.
Thanks for your help!,
C.


Reply With Quote
