Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

easy Q - remove return char

  • 05-08-2005 08:52AM
    #1
    Moderators, Arts Moderators Posts: 36,073
    Mod ✭✭✭✭


    I have a script to write a variable to a text file, using echo.
    However, it writes a return character at the end when I use
    echo $list > back.jobs
    How can I avoid it writing this return char, or alternatively remove the return char from the file afterwards?
    The text file created (just one line) needs to be readable by windows notepad afterwards.


Comments

  • Closed Accounts Posts: 24 Zoso


    I have a script to write a variable to a text file, using echo.
    However, it writes a return character at the end when I use
    echo $list > back.jobs
    How can I avoid it writing this return char, or alternatively remove the return char from the file afterwards?
    The text file created (just one line) needs to be readable by windows notepad afterwards.

    man echo might be a good place to start ?

    Hint: you're looking for the '-n' switch - although it's not supported on all flavours of Unix
    e.g. /usr/bin/echo on Solaris doesn't support it - however /usr/ucb/echo does.


  • Moderators, Arts Moderators Posts: 36,073 pickarooney
    Mod ✭✭✭✭


    I'm having to use a stripped down version of cygwin at the moment, with no man files and only some of the normal unix tools. I take your point though, man echo is available on the web.

    And cygwin does support the -n switch so happy days :)

    Thanks.


Welcome!

It looks like you're new here. Sign in or register to get started.
Advertisement