line 23 :syntax error unexpected end of file detected
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
line 23 :syntax error unexpected end of file detected
Below is a script in a software.
I used the command "source setup_env.csh" and it says
"line 23:syntax error unexpected end of file detected"
#setup_env.csh
echo "#####################################################################"
echo ""
echo "Setting up the environment ..."
if ( ! ( -d bin ) || ! ( -d lib ) ) then
echo "ERROR: Your installation is not proper or you are you are sourcing itt from a wrong directory ..."
echo "Contact support@questatechnologgies.com for any help "
echo "#####################################################################"
exit 1
endif
setenv QUESTATECH_HOME $PWD
setenv PATH "$QUESTATECH_HOME/bin:$PATH"
echo ""
echo "Completed the environment setup, you're all set to run the tool(s) ..."
echo ""
echo "#####################################################################"
echo ""
exit 0
thanks a lot if u help...and waiting eagerly for your reply
Please use [code][/code] tags around your code, to preserve formatting and to improve readability. ...And to prevent the page from side-scrolling.
An "end of file" error nearly always means that you've missed a closing mark of some kind. The parser reached the end of the file without finding the quote-mark, character, or word that's supposed to end an expression (or it found an unmatched opening mark that's not supposed to be there).
Don't pay too much attention to the line number given with the errors either; the message indicates the point where it couldn't continue to process the script, which is often not the place where the actual mistake lies. Work backwards from that point until you find the mistake.
That means, however, that there are no mistakes that I can see offhand. Not that I'm very familiar with csh myself. But most of the lines are just simple echo strings, all properly quoted AFAICT.
thanks a lot for your replies but i couldn't make out the mistake....
my observation says that the error is in the "if" conditional statement(i used a test echo before "if" and it worked fine)
so anyone who pin points the flaw reply me soon....
thanks for your patience and waiting for your cursor to be on the 'reply post' button
thanks a lot for your replies but i couldn't make out the mistake....
my observation says that the error is in the "if" conditional statement(i used a test echo before "if" and it worked fine) so anyone who pin points the flaw reply me soon....
thanks for your patience and waiting for your cursor to be on the 'reply post' button
Instead of waiting or telling us to hurry and "reply me soon", why don't you try to figure it out yourself?
Running the script under bash causes that error...and judging by the extension, it's a c-shell script. If I go into a cshell, it works fine...if not, it produces the error. Put a "#!/bin/csh" at the top.
Ok...is that the path for csh on your system?? What version? Because under csh 6.17.02, it works fine, and under bash it works fine as well, if I specify the /bin/csh line at the very top of the script.
What version/distro of Linux are you using, and do you want this to be a csh or bash script? It works fine as is under a csh environment, or by calling it explicitly in bash, as stated.
Moved: This thread is more suitable in <Software> as it has nothing to do w/ the kernel, and has been moved accordingly to help your thread/question get the exposure it deserves.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.