ksh to bash mode


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh to bash mode
# 8  
Old 10-24-2008
You could create it. What version of ksh you are using? On what platform?
# 9  
Old 10-24-2008
Quote:
... will affect everyone using that initialization file (the same username).
Sorry,
anyone having the same home directory or some custom way to pass an initialization file to the shell.
# 10  
Old 10-24-2008
dude...thx for your instant answers...appreciate that...
My KSH version : ksh88
My OS: SUN Solaris

Let me know what it takes to create a .kshrc file.
Do I need to have any admin privilges for doing this?.

-Anduzzi
# 11  
Old 10-24-2008
No,
just run this command:

Code:
printf "%s\n" "[ -x /bin/bash ]&&exec  /bin/bash -l">"$HOME"/.kshrc

Then, leave your current session open (just in case something goes wrong) and start a new one. Check your current shell in the new terminal:

Code:
ps -p $$

If it's bash, it should be OK.

Last edited by radoulov; 10-24-2008 at 05:18 PM..
# 12  
Old 10-24-2008
Unfortunately, I dont have a bash dir under /bin.

xsdetl01:/bin: ls -lart | grep '^d'
drwxr-xr-x 2 root bin 512 Sep 8 2007 sparcv7
drwxr-xr-x 2 root bin 1024 Sep 8 2007 sparcv9

I ran ur command though....it wudnt give out any error...
but opening up a new terminal, the shell doesnt change....

-Anduzzi
# 13  
Old 10-24-2008
So just type:

Code:
type bash

... and change the path accordingly.
# 14  
Old 10-24-2008
Sorry....thats my bad....bash file exists in /usr/bin.
but when I execute your cmd, just the statement (AS IT IS) goes into .kshrc and there is no execution.
When I execute .kshrc alone with the command inside it, the session completely exits.

Can we debug this?..

-Anduzzi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Fedora

Bash in Emergency Mode

I'm sure this is a really dumb question, but if I use a command in Fedora 23 emergency mode, and that command doesn't exist, I don't come back to the command prompt, but enter what appears to be a text mode. How do I get back to the command line? (2 Replies)
Discussion started by: bangorme
2 Replies

2. UNIX for Dummies Questions & Answers

New user in bash mode

when I created user and use su - username then its prompt come in bash mode # su - uusr -bash-4.1$ What is this bash mode . this also show -bash-4.1$ touch filename touch: cannot touch `filename': Permission denied Please use CODE tags (not ICODE tags) when displaying... (2 Replies)
Discussion started by: kaushik02018
2 Replies

3. Shell Programming and Scripting

tftp batch mode within bash script

Hi, I put the necessary tftp commands into a batch file and I can run tftp by $ tftp < tftpbatchscript in bash command line and then successfully exit. Now, I want to put a line which does the same thing above. However, when I put this line into a bash script, the lines below this line... (1 Reply)
Discussion started by: yildiz.a
1 Replies

4. Shell Programming and Scripting

set ksh script in restricted mode

Hi, I came across a post wherein you can use "set -r"(on bash) to activate restricted mode ( wherein you cant run some commands such as cd etc). Can anyone guide if we have anything similar in ksh ? Thanks (2 Replies)
Discussion started by: Shivdatta
2 Replies

5. Shell Programming and Scripting

BASH to KSH

I have a script in KSH and now need to incorporate this into another script which is in BASH. OUr script contains code like below in good number of places. Eg: echo “A B C” | read VAR1 VAR2 VAR3 This works only in ksh and not in BASH. Please let me know 1. Which is the equivalent... (3 Replies)
Discussion started by: cvsanthosh
3 Replies

6. UNIX for Dummies Questions & Answers

bash preferred or ksh with bash features

I'm a user on a fairly locked down sys V server. By default, I have ksh set as my default shell. I added to my .profile: bash -o vi so when I login, it goes into bash so I can take advantage of tab completion and use the up key to bring up previous commands. However, whenever I want to exit, I... (2 Replies)
Discussion started by: mrwatkin
2 Replies

7. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

8. UNIX for Dummies Questions & Answers

ksh in vi mode, choose from output

is there a way to choose the complement from the output from the sequense in "ksh -o vi" root# ls testa testb root# cat tes 1) testa 2) testb root# cat tes <-- what to do now? this output looks like a select function, otherwise the numbers wouldn't make sense, is there a chance to use... (2 Replies)
Discussion started by: pressy
2 Replies

9. Shell Programming and Scripting

python vs bash - verbose mode

hey all! i'm looking how to render verbose python scripts. what i'm looking for would be an equivalent to a "bash -xf" in bash script headers.. Any help? (2 Replies)
Discussion started by: penguin-friend
2 Replies

10. Shell Programming and Scripting

Ksh vs Bash

Hi Buddy, Can any one help me to overcome from the below problem? #/usr/bin/ksh typeset -Z dd dd=1 echo $dd =========== out put for the above is 01 same script I'm migrating to bash but typeset -Z option is not found in bash, Pls get me the equivalent option in BASH Thanks in... (1 Reply)
Discussion started by: krishna
1 Replies
Login or Register to Ask a Question