[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

Shell Scripting on Cygwin and Windows

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
herggo
Asked:
herggo
1 Solution
 
rbrideCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now