.profile problem using set -o vi


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .profile problem using set -o vi
# 1  
Old 12-21-2006
.profile problem using set -o vi

The “set -o vi” command won't run in the .profile. WHY?
This has me puzzled as the problem seems to be too simple, but can't figure it out. Here's the info...
Running...
Generic sun4u sparc SUNW,Ultra-5_10
K shell

Here's the .profile
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
stty istrip
stty erase ^H

NDMAPICFG=/home/user01/cdunix/ndm/cfg/cliapi/ndmapi.cfg
export NDMAPICFG

PATH=/usr/bin:/usr/local/bin/:/usr/ucb:/etc:/home/user01/cdunix/ndm/bin:.
export PATH

set -o vi


So why is it not taking the set command in the .profile?

Last edited by jimmyc; 12-21-2006 at 03:54 PM..
# 2  
Old 12-21-2006
What's the error, either when you log in or if you type the command in at the command line? What's your shell (check /etc/passwd to be sure).

Carl
# 3  
Old 12-21-2006
Shell is K shell
No error produced.

It doesn't appear to execuite the set -o vi command from the .profile. Once I'm at the command line set -o vi works just fine. I was hoping to set it up in the .profile
# 4  
Old 12-22-2006
I think your logon shell must be ksh if you want to put set -o vi in the .profile
# 5  
Old 12-22-2006
jimmyc, change that line to:
ps -f
set -o
set -o vi
set -o

and post the output when you logon.
# 6  
Old 12-22-2006
I checked on a Solaris 8 box, with ksh and it works just fine. Make sure that your shell is indeed ksh and (this may be a bit silly) make sure that your home directory exists and that you have write permissions on it. Otherwise ksh won't be able to write to the .sh_history file and you won't get any history.

Cheers,
# 7  
Old 12-22-2006
Output from Perderabo's request:
ps -f
UID PID PPID C STIME TTY TIME CMD
user01 6321 6320 0 06:25:43 syscon 0:00 ksh
user01 6325 6321 0 06:25:54 syscon 0:00 ps -f

set -o
Current option settings
allexport off
bgnice on
emacs off
errexit off
gmacs off
ignoreeof off
interactive on
keyword off
markdirs off
monitor on
noexec off
noclobber off
noglob off
nolog off
notify off
nounset off
privileged off
restricted off
trackall off
verbose off
vi off
viraw off
xtrace off


$ set -o vi
$ set -o
Current option settings
allexport off
bgnice on
emacs off
errexit off
gmacs off
ignoreeof off
interactive on
keyword off
markdirs off
monitor on
noexec off
noclobber off
noglob off
nolog off
notify off
nounset off
privileged off
restricted off
trackall off
verbose off
vi on
viraw off
xtrace off


See when the .profile runs it doesn't execuite the set -o vi. Only after I'm at the command prompt does it work. My home dir is fine I run lots of other scripts, pickup and drop off file from it. The only thing I can think of is... During the execuition of the .profile, if it spawns another k-shell runs the set -o vi there, then closed the shell, I would never see it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"ksh: XYZ: parameter not set" in .profile

Hi, A very basic query. I am working on two different UNIX servers and I see different behaviours for my user id. This has to be a setting in the .profile, but I can't seem to find where :confused: So, in one server if I type echo $XYZDD (a random variable), I get a blank line with no... (2 Replies)
Discussion started by: ALDonP
2 Replies

2. Shell Programming and Scripting

How to set up newgrp on .profile?

Hello all, I am having an issue setting up an environment on .profile. I want to set up my .profile in that way that everytime I login to the host, it should automatically set up my group. I tried the folllowing but it doesn't work. It is on the solaris OS. HOSTNAME=$(hostname) if ] || ]... (14 Replies)
Discussion started by: Pateltiger
14 Replies

3. AIX

How to make LOGNAME writeable? It is set as READONLY in .profile

LOGNAME variable is set as READONLY in .profile. I want to make it WRITEABLE so that I can modify the LOGNAME values programatically/throush shell programs. Thanks, Guru (1 Reply)
Discussion started by: gurubbc
1 Replies

4. Solaris

How do i permanently set bash profile??

Hi all, I don't want to enter below command on solaris every time. How do i permanently set this command on Solaris. I know that this operation is a piece of cake on redhat because there is a /etc/rc.local file on it. But Solaris ???? bash-3.00#export PS1="\e (2 Replies)
Discussion started by: getrue
2 Replies

5. Solaris

profile problem

for some reason my profile doesnt seem to be loading. here is some info $SHELL /sbin/sh $HOME / (yup, im running at root, its a VM and im using it to learn) created /.profile added something simple to test, PS1="test" logout and back in, open a terminal... prompt is still # ... (2 Replies)
Discussion started by: jrich523
2 Replies

6. Shell Programming and Scripting

problem with .profile

I am trying to execute my .profile which has the path to oracle home. But when I execute it with the below command it says nothing and when I try to echo the ORACLE_HOME I am still in my home directory itself which means it didn't get executed. Please help how to make sure that .profile is... (6 Replies)
Discussion started by: dsravan
6 Replies

7. UNIX for Dummies Questions & Answers

set background/foreground color in .profile

I am using a telnet session (VT100) and need to modify my .profile so that it will set the color of the telnet session. I am not using Xterm (ie: can't use .Xdefaults). I am able to change the colors via menu's but need to preset in .profile. Is this possible??? Can't find anything at all on how... (3 Replies)
Discussion started by: dvella
3 Replies

8. UNIX for Dummies Questions & Answers

problem with .profile

Hi, i am changing something in .profile file and then esc :wq!. when i do the cat i can see the changes. but to bring the .profile in memory i have to do . .profile.but it says error while doing that is . .profile ksh: .profile: not found. can any body help thanks in advance sam71 (7 Replies)
Discussion started by: sam71
7 Replies

9. UNIX for Dummies Questions & Answers

ssh2: .profile not set correctly

When logging into solaris box through ssh, my profile does not get set correctly and I'm presented with the default ksh prompt "$". When logging in through telnet, everything is set correctly. Is there a special profile that sshd runs? ssh2: F-Secure SSH 2.4.0 (build 15) on sparc-sun-solaris2.8 (0 Replies)
Discussion started by: dangral
0 Replies

10. UNIX for Dummies Questions & Answers

Problem with .profile

I wanted to add /home/oracle/sql to my path so that from which ever directory i connect to sqlplus i should be able to source the .sql files sitting in /home/oracle/sql. Also, this is what i tried but it doenst work # Set up the search paths: export ... (2 Replies)
Discussion started by: jigarlakhani
2 Replies
Login or Register to Ask a Question