Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have been working my way trough a book on shell scripts. Cool book so far. I started to write a script with VI in a terminal on my my Mac Book. I then scp'd it to my linux box and finished writing it in VI on my Linux box. When I run it I get the error "line 45: syntax error: unexpected end of file" My script ends on line 44. All I can think of is the line endings are different between Mac and Linux and that is what is wrong. I know that there is dos2linux for dos to linux file conversions. Is there any thing for mac to linux?
Can you post the script. It's far more likely you've missed a closing quote somewhere, and the shell hasn't found it by the end. AFAIK MAc and other Unix have the same line endings. Maybe it's worth a try with dos2unix anyway,
I will go ahead and post the script but you were right. if and fi, damn dyslexia gets me every time. It was the last fi that I typed as an if. Thank you any way.
#!/bin/sh
# normdate -- Normalizes month field in date specification
# to three letters, first letter capitalized. A helper
# function for the script #7, valid-date. Exits w/ zero if no error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.