[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: ^M Appends to every line?

From: Christopher D Haakinson <cdhaakin_at_us.ibm.com>
Date: Thu, 24 Feb 2011 12:55:14 -0500

I'd like someone to explain how this small shell script, which works fine,
gets corrupted simply by creating a new file and copy/pasting the text in
it. Here's what I'm doing:

1) I have a test shell script that runs fine. Here's the content:
<------------------------- start
        lock="/tmp/deleteme"
        if [ -f $lock ]
        then
                echo "Lock file exists. Wait until it's gone to proceed. ."
                while [ -f $lock ]
                do
                        echo "Waiting for lockfile to be removed. ."
                        sleep 1s
                done
                echo "Now creating lock file"
                echo "locked" > $lock
        else
                echo "No lock file found. Creating it. ."
                echo "locked" > $lock
        fi
echo "Lets try this again, hopefully for the last time...."
exit 0
<-------------------------- end

2) I copy this entire script from notepad in windows into a new file named
test2.sh, also in notepad.
3) Using TortoiseSVN, I add test2.sh into my project
4) I commit the changes to the server
5) On my linux server, I run: svn update ... to get the test2.sh file
6) Now when I try to run it I get this:
                syntax error: unexpected end of file

Now, this is the most simple task I could think of doing, and this doesn't
work. I've also tried creating the new shell script with Komodo EDIT with
the same results.

This occurs even though I've tried adding svn:eol-style from both my linux
server and my windows wrx... I'm lost!!

|------------>
| From: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |Les Mikesell <lesmikesell_at_gmail.com> |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |users_at_subversion.apache.org |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |02/24/2011 11:27 AM |
>------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: ^M Appends to every line? |
>------------------------------------------------------------------------------------------------------------------------------------------------|

On 2/24/2011 10:02 AM, Christopher D Haakinson wrote:
> OK, so I've been testing out the svn:eol-style prop and it appears to
> work, but it seems like an awful lot of work for such a simple issue.
>
> Is there something server-side I can setup to ensure that all files
> contain the correct eol style?

No, the server can't possibly know what is right either for any
particular file or for any particular client platform. But, your client
configs control auto-props which can sometimes do the right thing
automatically on the client side. Unfortunately those have to match
filename patterns that won't necessarily correspond to the file content
or use.

> Also I've noticed that my shell scripts are now failing with an EOF
> error? Does this mean that there's a style setting for the end of file
too??

No, that probably is related to some other error or parsing issue in the
file.

--
   Les Mikesell
     lesmikesell_at_gmail.com


graycol.gif ecblank.gif
Received on 2011-02-24 18:55:59 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.