+ Post New Thread
Results 1 to 11 of 11
*nix Thread, WATCH OUT!- there's a <CR> about :( in Technical; For those of you like myself, who consider themselves multi-OS capable having worked on everything from a Cyber 1900 to ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,829
    Thank Post
    1,476
    Thanked 594 Times in 446 Posts
    Rep Power
    169

    WATCH OUT!- there's a <CR> about :(

    For those of you like myself, who consider themselves multi-OS capable having worked on everything from a Cyber 1900 to a W2k3 server ....

    DON'T MAKE UP A LINUX SCRIPT USING A WINDOWS EDITOR AND EXPECT IT TO WORK WHEN RUN ON A LINUX BOX

    Why?

    Basically, your Linux scripts end up having a <CR> before each line and gives errors or even worse results

    Hope my experience helps someone else

    And sorry to Geoff once again

    regards

    Simon

    PS At ZH - still hitting image limit with my smileys!

  2. #2
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    Out of interest what editor were you using? I'd say it's probably more related to that than a specific *nix - windows issue.

    Cheers
    Jona

  3. #3

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,239
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    I had this problem at one point, notepad and other windows editors all seem to offend as they save the file with these little buggers on each line. The solution was to open the files in a linux editor and just scroll down with the cursor line by line at which point the editor removed the characters. Re-saving the file after this made them function.

  4. #4

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,829
    Thank Post
    1,476
    Thanked 594 Times in 446 Posts
    Rep Power
    169
    @Jona

    1. I can't remember.

    2. Did you read the link?

    regards

    Simon

  5. #5

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    18,130
    Thank Post
    522
    Thanked 2,540 Times in 1,975 Posts
    Blog Entries
    24
    Rep Power
    875
    It depends on the editor really - better editors allow you to save in 'unix text' format, otherwise known as the proper way of doing it. Notepad is terrible for that problem.

  6. #6
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    yeh notepad is a bit evil for this kind of thing, I use pspad and it seems to work a lot better - http://www.pspad.com/

  7. #7


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,485
    Thank Post
    867
    Thanked 853 Times in 674 Posts
    Rep Power
    197
    There's a few tricks to this:
    1. Use a real editor http://www.vim.org/ - in vim:
    escape
    :set ff=unix
    :wq

    2. use a commandline util to fix it - on ubuntu:
    apt-get install sysutils
    dos2unix <filename>

    HTH

  8. #8
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,993
    Thank Post
    120
    Thanked 286 Times in 263 Posts
    Rep Power
    107
    I use textpad and save as a unix file.

  9. #9
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    436
    Thank Post
    75
    Thanked 94 Times in 78 Posts
    Rep Power
    63
    notepad ++

    http://notepad-plus.sourceforge.net/uk/site.htm

    superb little app! syntax highlighting for so many things.

    regards

    BoX

  10. Thanks to box_l from:

    SimpleSi (30th March 2008)

  11. #10

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,829
    Thank Post
    1,476
    Thanked 594 Times in 446 Posts
    Rep Power
    169
    Ta for replies - I'm trying out Notepad++ as its in the PortableApps suite so I can just stick it on the USB stick I use for my eeePC scripts and run it from there when I need to edit from Windows.

    regards

    Simon

  12. #11
    Joedetic's Avatar
    Join Date
    Jan 2006
    Location
    Walsall
    Posts
    1,316
    Thank Post
    6
    Thanked 13 Times in 13 Posts
    Rep Power
    22
    I use notepad++ as my text editor in windows It's excellent. I just use nano in *nix/*BSD

SHARE:
+ Post New Thread

Similar Threads

  1. Watch out there's a thief about.
    By laserblazer in forum General Chat
    Replies: 16
    Last Post: 12th December 2007, 02:06 PM
  2. Sports do you watch
    By russdev in forum General Chat
    Replies: 21
    Last Post: 6th August 2007, 08:48 PM
  3. how do i watch tv on my laptop
    By callumtuckey in forum How do you do....it?
    Replies: 7
    Last Post: 30th June 2007, 06:14 PM
  4. Santa Watch
    By russdev in forum General EduGeek News/Announcements
    Replies: 0
    Last Post: 23rd December 2005, 05:47 PM
  5. Anyone watch '24'
    By Mango_RW in forum General Chat
    Replies: 1
    Last Post: 20th July 2005, 07:54 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •