The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem in updating .profile file in HP-UX B.11.00 machine abhishek0071 UNIX for Advanced & Expert Users 3 02-07-2008 11:06 AM
problem with .profile dsravan Shell Programming and Scripting 6 04-23-2007 09:35 PM
problem with .profile sam71 UNIX for Dummies Questions & Answers 7 05-20-2005 04:04 AM
Problem with .profile jigarlakhani UNIX for Dummies Questions & Answers 2 03-02-2004 08:43 AM
changed .profile but didnt ./.profile, yet reflected changes yls177 UNIX for Dummies Questions & Answers 4 12-05-2002 07:21 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-21-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 43
Stumble this Post!
.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 11:54 AM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-21-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 395
Stumble this Post!
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
Reply With Quote
  #3 (permalink)  
Old 12-21-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 43
Stumble this Post!
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
Reply With Quote
  #4 (permalink)  
Old 12-21-2006
Registered User
 

Join Date: Nov 2006
Posts: 252
Stumble this Post!
I think your logon shell must be ksh if you want to put set -o vi in the .profile
Reply With Quote
  #5 (permalink)  
Old 12-21-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,444
Stumble this Post!
jimmyc, change that line to:
ps -f
set -o
set -o vi
set -o

and post the output when you logon.
Reply With Quote
  #6 (permalink)  
Old 12-21-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
Stumble this Post!
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,
Reply With Quote
  #7 (permalink)  
Old 12-22-2006
Registered User
 

Join Date: Dec 2006
Location: dallas tx
Posts: 43
Stumble this Post!
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0