LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2001, 09:14 PM   #1
King V
Member
 
Registered: Oct 2001
Location: New Jersey
Distribution: Mandrake 10.2
Posts: 75

Rep: Reputation: 15
Unhappy Using echo with ksh on Linux...


Has there been some sort of change in the use of the echo command relatively recently?

About a year, maybe year and a half ago, I wrote a shellscript on a Solaris 2.6 machine, executing in a ksh, that basically takes a certain text file as input and formats it nicely to make a table on a web page.

Lot of use of the echo command, of course, and redirected output to a file.

So now I tried running the thing on my Mandrake 8.1 machine, and I get some really weird output.

I used the \n and \t escape codes to create newlines and tabs, but for some reason, on my Linux box, instead of actually doing newlines and tabs, it literally shows the characters "\t" and "\n" as text.

A friend of mine tried it on his Red Hat 7.1 box, as well as his Solaris 2.8 machine, same deal.

He later found out that using the -e option makes the echo command behave as expected.

However, when did this become a requirement? I never needed to specify that before, and was wondering why the change happened. I just did a lookup of the man page on the web (ack, I'm on my Win9x box right now) and it doesn't make mention of the need for any -e argument.

What am I missing here?
 
  


Reply



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
linux echo effect Youssef_C Linux - Software 1 10-31-2004 04:26 PM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 02:59 PM
Shell Script that misbehaves under Linux but works in HP UX well... ksh environ. sammathew Linux - Software 7 09-17-2003 08:42 PM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 01:13 PM
@echo off -> Exist in Linux? bfloeagle Linux - General 3 07-24-2001 01:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration