Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

How to do an echo onto the same line in Solaris

  • 12-04-2011 05:25PM
    #1
    Registered Users, Registered Users 2 Posts: 5,816 ✭✭✭


    Using a script to output some lines to a file but want to do seperate echo statements to the same line

    Ive tried

    echo -n
    echo -c

    But the stupid things go onto the next line. A gurus advice would be mucho appreciated


Comments

  • Registered Users, Registered Users 2 Posts: 2,082 ✭✭✭Tobias Greeshman


    Use printf instead, I recall before that some versions of echo on Solaris were equivalent to a printf with a \n. So a printf should sort you out.


  • Registered Users, Registered Users 2 Posts: 1,456 ✭✭✭FSL


    Unless I am completely misunderstanding, if you are trying to echo after you have outputted the line then surely you need to output the line without the newline on the end.


  • Registered Users, Registered Users 2 Posts: 3,721 ✭✭✭E39MSport


    echo "$text1 $text2 $text3" etc etc


  • Registered Users, Registered Users 2 Posts: 5,816 ✭✭✭veryangryman


    Use printf instead, I recall before that some versions of echo on Solaris were equivalent to a printf with a \n. So a printf should sort you out.

    Lifesaver cheers dude :D


Advertisement
Advertisement