Find the answer to your Linux question:
Results 1 to 4 of 4
When in command mode one can come out of the file temporarily by Code: :sh in command mode When I find myself on the shell on RH 9 the aliases ...
  1. #1
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    vi command mode :sh

    When in command mode one can come out of the file temporarily by
    Code:
    :sh in command mode
    When I find myself on the shell on RH 9 the aliases dont work but in RHEL 4 all aliases work like charm. Does anyone know why is it so?
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    As nobody has replied, I'll have a quick stab at this:

    It could be that vi is starting off the shell as a different user to the one that you're logged in as.

    It could be that the envirionment is not being preserved correctly across the system.

    It could be the age of the version of Bash that you're using, for RH9 (getting on for 10 yrs old now) it could be that it's implementation of the shell doesn't carry over the environment properly.

    You could take a poke through the vi settings docs to see if there's any external shell parameters you need to pass through that are there on the new version but are missing on the old?

    Sorry I cant be much more help, but I'm pretty unfamiliar with the way this works under the hood.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    I'll see if I can add, though I don't know too much either.

    My guess is that your aliases are defined in ~/.bash_profile. When you launch a subshell, which is what you're doing, it does not read the settings of the parent shell as defined in .bash_profile, but instead reads ~/.bashrc for configurations.

  4. #4
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    thanks for repling guys
    Yes my aliases are defined in the .bash_profile which are not read during the launch of the subshell. I prefer to work in RHEL 5 but it was a doubt that was echoing again and again so I asked it out.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...