Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using \c in Linux script.

Status
Not open for further replies.

peterneve

Programmer
Jan 24, 2002
50
GB
I have a unix script which uses \c to print things on the same line, eg.

echo "Doing something ...\c"
# Do something
echo " done."

This doesn't work in linux.

Any ideas anyone?

Thanks
 
Hi:

I use my echo_n function in my bash and ksh scripts.
Place this at the beginning of your script:

[[ "$(echo -n)" == "-n" ]]
&& function echo_n { echo "$@\c"; } || function echo_n { echo -n "$@"; }

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top