LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   escape characters not escaping (http://www.linuxquestions.org/questions/linux-software-2/escape-characters-not-escaping-168031/)

BobNz 04-09-2004 03:05 AM

escape characters not escaping
 
Hi, this...

[root@jekyll root]# cat won
echo
echo "Date and Time: \c "
date
echo "Number of users on the system:\c"
who | wc -l
echo "Your directory:\c"
pwd
echo

produces this...

[root@jekyll root]# sh won

Date and Time: \c
Fri Apr 9 19:58:01 NZST 2004
Number of users on the system:\c
4
Your directory:\c
/root

In the book I'm using \c should prevent the carriage return.
I'm using a bash shell.
rh9.0

any thoughts appreciated.

Bob

mikshaw 04-09-2004 03:24 AM

echo -e "Date and Time: \c "

BobNz 04-09-2004 03:34 AM

Thanks, its an old book doesn't mention -e

Bob


All times are GMT -5. The time now is 10:41 AM.