LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-09-2004, 03:05 AM   #1
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Rep: Reputation: 15
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
 
Old 04-09-2004, 03:24 AM   #2
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
echo -e "Date and Time: \c "
 
Old 04-09-2004, 03:34 AM   #3
BobNz
Member
 
Registered: May 2003
Location: NewZealand
Distribution: RH9.0
Posts: 74

Original Poster
Rep: Reputation: 15
Thanks, its an old book doesn't mention -e

Bob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing escape characters along with lp command zita Linux - General 0 10-05-2005 01:58 PM
Variables and escape characters? flobadon Programming 4 09-10-2005 04:34 PM
bach scripting and escape characters... Bud-froggy Linux - Newbie 3 07-09-2004 04:55 PM
Escape Characters in linux shunraj Linux - Software 1 05-18-2004 03:21 PM
Handle escape characters in a string Helene Programming 7 05-01-2004 11:43 PM


All times are GMT -5. The time now is 04:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration