Unix Shell Script Line Ending & Executable Issue With Subversion

Unix Shell Script Line Ending & Executable Issue With Subversion

Friday, July 18, 2014

5:37 PM

Unix File Line Ending always gives you problem if you have your development environment in Windows and servers in Unix. Also if you are using Subversion as source control system then you need to be very careful about line endings.

I had this issue where a shell script was deployed on Unix machine. But I was not able to run the shell script. It gave error:

$> ./myShellScript.sh
: bad interpreter: No such file or directory

Thus while working with shell script we must make sure that we set proper properties to the script. I solved the above issue by adding two subversion properties to the shell script.

svn:eol-style – native

svn:executable – *

If you are using Tortoise Client for Subversion, right click on the shell script file > Tortoise SVN > Properties.

tortoise-svn-properties

Similarly add property “svn:eol-style” with value native to subversion properties.

svn-properties-unix-shell-script

By adding above properties, the Shell Script line ending issue will be resolved.

 

Created with Microsoft OneNote 2013.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s