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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

easy Q - remove return char

  • 05-08-2005 7:52am
    #1
    Moderators, Arts Moderators Posts: 35,731 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: 35,731 Mod ✭✭✭✭pickarooney


    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.


Advertisement