I'm attempting to set up a two-line prompt using Korn.
This is what I've set up in .kshrc
And in .profile,
The hosts that in use are either running RHEL kernel 2.6.8-xx with ksh88 or 2.6.9-xx with ksh93
This works perfectly for most hosts and I get the desired output:
But on some hosts I get this error when I login:
I also noticed that != changes to a number (1074 in this example) and increases by 1 if I hit Enter.
I'm using the same syntax on all hosts and cannot figure out this error.
My guess is the difference in the ksh version.
Please help me figure out what I'm doing wrong.
Also, is there a way to force ksh to behave consistently across older versions?
I'm attempting to set up a two-line prompt using Korn.
This is what I've set up in .kshrc
And in .profile,
The hosts that in use are either running RHEL kernel 2.6.8-xx with ksh88 or 2.6.9-xx with ksh93
This works perfectly for most hosts and I get the desired output:
But on some hosts I get this error when I login:
I also noticed that != changes to a number (1074 in this example) and increases by 1 if I hit Enter.
I'm using the same syntax on all hosts and cannot figure out this error.
My guess is the difference in the ksh version.
Please help me figure out what I'm doing wrong.
Also, is there a way to force ksh to behave consistently across older versions?
Did you also notice the line break in the middle of print shown in red above?
Are you sure that .kshrc has the same contents on both systems?
Get the version of ksh you are using echo $KSH_VERSION and change all print statements to echo and see if that'd help...
echo $KSH_VERSION throws a blank line,
I use the vi mode, so an ESC and a CTRL +V gives me the version.
For simplicity, I'll narrow it down to the 93 versions and skip the 88 as host with the older versions are miminal.
I have a feeling its not the KSH version thats causing this.
The prompt works perfectly on:
It fails on
Works well on some fails on others with:
On the hosts on which it failed, replacing print with echo ignores the newline character, throwing this output:
Quote:
Did you also notice the line break in the middle of print shown in red above?
Are you sure that .kshrc has the same contents on both systems?
I'm sorry that line break is actually the STDOUT on the terminal. I should have corrected it before pasting it here.
The .kshrc has no line breaks and is consistent on all hosts.
Hi,
I am learning shell scripting for the first time. I use AT&T Korn Shell, Version AJM 93u+ 2012-08-01, compiled from source on NetBSD.
So far I have managed to set up what I think is a useful and pleasing shell prompt, which can be seen in the image attached to this post.
The prompt is... (2 Replies)
Hi,
I am trying to put together a Korn Shell script to insert at a specific line.
The system we use is SunOS 5.10
I can get the line number by using:-
num=`sed -n '/export ENV/=' ./tmp.file`
Not getting much headway using the above variable's value to insert -
export SYBASE=/opt/sybase15... (5 Replies)
Korn Shell in AIX 6.1
I want to print the below shown pipe (|) separated list line by line.
line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883
for i in line
do
echo "Hello $line "
done
I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Can anybody help me with this small script , the script works fine and launches the IE from
c:\documents and settings \test\my documents>ksh prompt
$RunURL1.sh
this scitpt works and launches the ie from ksh , but when i schedule it to run the script then i get the error box saying command:1... (2 Replies)
Hello,
I want to connect to Database through shell command line.
Here is my command from putty,
$ sqlplus -S ora/ora@ORA
But I am not able to connact to database.
If this command succed, what is the expected output on shell prompt?
Could you please let me know how to connact to... (3 Replies)
Hi guys , i need help so bad on this issue..
Basically i have to delete the line continuation symbol of first column variable and add the truncated part of that word in next line to first line.
here i written sample 3 lines but originally i have bunch of lines in that file.
client1_day- ... (3 Replies)
My client`s system is an AIX 4.2 and using the Kron shell. I was just wondering if it is possible to have the prompt autocompletion enabled on it without changing shell version.
By autocompletion, I mean to automatically complete the filenames or directories we type in using the Tab key. (2 Replies)
Hlo sir
My system file / system file is full and i am unable to enter any command such as ls or to start my server RS6000 The network is blocked and the users are log off. (0 Replies)
I know this is very easy. I just am having a problem determining how to do it.
I want to have a 2-line command prompt when you hit return. I have no problem creating or exporting a PS1, but can't make into 2 lines.
hostname-user:/path/to/dir
#
I really should know this, but my brain... (7 Replies)