Solved

Shell Scripting on Cygwin and Windows

Posted on 2011-09-29
1
454 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

Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

Join & Write a Comment

A list of useful business intelligence software.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

708 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

16 Experts available now in Live!

Get 1:1 Help Now