12-22-2009
New line character problem with ksh on Redhat Linux
Guys,
I would like to discuss the problem I am seeing with echo “\n” statement in Redhat Linux Enterprise 5.3 version. I have a shell script that was written couple of years back for generic UNIX platforms based on ksh and was tested on Solaris 8,9,10 ; AIX 5.3 and Red Hat Enterprise Linux AS release 4. It has used echo with \n option inside all places to print the outputs as standard with ksh (bash was not installed by default that tome on Solaris and AIX) interpreter that was standard that time to get it working on all above platforms.The script is basically a package which has thousands of lines divided into 10- to 15 .sh files.
Now the problem is that when I deploy the script on top of Red Hat Enterprise Linux Server release 5.3, all the echo segments are printing \n as it is, which means its not treating as \n as new line characters. For example
echo "\nOPERATION SUCCESSFUL"
is printing as \nOPERATION SUCCESSFUL.
Its getting printing perfect in Solaris 8,9,10 ; AIX 5.3 and even on Red Hat Enterprise Linux AS release 4.
To replace echo with \n option with printf statement is not feasible as the programs is quite a big. Can anyone please tell me the basic difference Redhat have implemented in ksh version of Redhat Linux Enterprise 5.3?
If anyone has any solution to work echo \n as it is on Redhat Enterprise 5.3, please help me.
Thanks,
Rijesh.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
can someone tell me what commands in Linux RedHat 8.0 will give me a graph of whats going on on my system. When Is ay graphs I mean graphs like does produced by perfview of solaris and glance of HP-UX. (3 Replies)
Discussion started by: TRUEST
3 Replies
2. UNIX for Dummies Questions & Answers
Hey guys,
can anyone please tell me how I can make linux recognize the same video adapter/monitor type that my windows box is using? i'm running linux redhat on virtual PC which enables me to have windows and linux running at the same time. (i can switch back and forth between operating... (4 Replies)
Discussion started by: TRUEST
4 Replies
3. Red Hat
We have a redhat linux el4 and used as a mail server.We configured postfix.all r working fine.we got a problem for a particular user when he tries to open his mailbox and the error is mentioned below:
ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: Internal error... (3 Replies)
Discussion started by: ramjimh2k3
3 Replies
4. Red Hat
we are using redhat linux,configured the postfix as mail server and outlook is used as mail client.whenever the user opens outlook it is start downloading all the mails from the server.
Example : If a user has 50 mails in the server,whenever he opens the outlook the outlook will start... (0 Replies)
Discussion started by: ramjimh2k3
0 Replies
5. Red Hat
Hi,
I am trying to do rsh on to a redhat EL 5 machine. It repeatedly asks me for the password and die after sometime. One might think that I am giving the wrong password. But I can do 'ssh' on to that machine with the same password.
Can someone tell me what I have been doing wrong?
... (2 Replies)
Discussion started by: eamani_sun
2 Replies
6. Red Hat
Hi All
when I give the command,
$ ping <hostname>
I get the following error
ping: unknown host <hostname>
I have checked in the following files,
/etc/sysconfig/network
/etc/hosts
/etc/resolv.conf
/etc/nsswitch.conf
Every where in these files host name and IP address are given... (2 Replies)
Discussion started by: nagapradeep
2 Replies
7. Shell Programming and Scripting
Hi I am executing a KSH script by passing command line arguments
example: Red Green Dark Red Blue
when I am splitting the arguments by using " "(Space) as delimiter
But the colour Dark Red is a single parameter. But it is getting splitted in between
How to avoid this. Please help Also... (4 Replies)
Discussion started by: hemanth424
4 Replies
8. Red Hat
hello all,
If i send mails using postfix,the mails stored in queue,not delivered to required recipient...can anyone please tell me the solution for this problem... (4 Replies)
Discussion started by: tilakraj
4 Replies
9. Shell Programming and Scripting
Hi All,
"Please read the below information carefully."
i have tried the below code for counting the number of lines present in text file ignoring blank lines
#! /bin/bash
clear
rdCount=0;
while read myline
do
if ; then
echo "line is empty"
else
echo $myline
let... (10 Replies)
Discussion started by: aish11
10 Replies
10. Shell Programming and Scripting
I have a ksh shell script and i need to pass arguments which are generated by data pulled from a database.
When the argument to the shell script is too long (about 4000 charecters) the below is the issue observed.
I copy the command which is 4000 charecters long from the logs and paste it... (7 Replies)
Discussion started by: mohtashims
7 Replies
LEARN ABOUT X11R4
suspend
suspend(1) User Commands suspend(1)
NAME
suspend - shell built-in function to halt the current shell
SYNOPSIS
sh
suspend
csh
suspend
ksh
suspend
DESCRIPTION
sh
Stops the execution of the current shell (but not if it is the login shell).
csh
Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su.
ksh
Stops the execution of the current shell (but not if it is the login shell).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5)
SunOS 5.10 15 Apr 1994 suspend(1)