Solved

Shell Scripting on Cygwin and Windows

Posted on 2011-09-29
1
457 Views
Last Modified: 2013-11-15
A blank line in a shell script causes an error:
: not found[72]:
I have a lot of scripts running on UNIX-Boxes, which have too run on Windows-Servers too. Is there a way to adjust the Korn Shell or must I edit all scripts?
0
Comment
Question by:herggo
1 Comment
 
LVL 4

Accepted Solution

by:
rbride earned 500 total points
ID: 36813497
I suspect that you are running into the dreaded DOS/UNIX file problem.
Windows text files have different line endings to unix files and you can get problems if the file is in the wrong format for your system. I run bash / sh for cygwin and need to change format to unix to run under cygwin properly every so often.

You can convert the files using dos2unix or unix2dos which are available on cygwin.
http://linuxcommand.org/man_pages/dos2unix1.html
http://linuxcommand.org/man_pages/unix2dos1.html
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your app took Google’s lash recently, here are the 5 most likely reasons.
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now