Unix Shell Script Line Ending & Executable Issue with Subversion

      

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.


Facebook  Twitter      Stumbleupon  Delicious
  

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Copyright © 2010 ViralPatel.net. All rights reserved.