Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Debug the skipping of .bashrc when bang out from vim PC version
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
AndyHancock  
View profile  
 More options Aug 27 2012, 1:55 am
Newsgroups: comp.unix.shell, comp.unix.questions, alt.comp.lang.shell.unix.bourne-bash, comp.unix.misc, alt.unix
From: AndyHancock <andymhanc...@gmail.com>
Date: Sun, 26 Aug 2012 22:55:33 -0700 (PDT)
Local: Mon, Aug 27 2012 1:55 am
Subject: Debug the skipping of .bashrc when bang out from vim PC version
It is often more covenient to use the Windows install of gvim than to
fire up Cygwin's X-windows to run the Cygwin version of gvim.  In
order to be able to bang out to run bash commands, I have this in my
vimrc:

   shell=c:\cygwin\bin\bash.exe\ -i

This allows me to do things like

   !!ls

or

   :w !cat

However, this only works when I launch the Windows version of gvim
from my Administrator account.  When I try those commands from a non-
administrator account, I get:

   shell return 127 bash: ls: command not found

or

   shell return 127 bash: cat: command not found

It actually took a while to recognize this pattern with the
administrator account.  I thought it would be simple to track down the
cause after finding this.  I thought I could simply set

   shell=c:\cygwin\bin\bash.exe\ -i\ -v

Then I could do echo the results of the shell-outs to register a and
paste them somewhere:

   :redir @a !!ls :w !cat :redir END

I confirmed that

   c:\cygwin\bin\bash.exe -i -v

actually echos every gruesome detail by issuing it from the command
line.  However, setting vim's "shell" option to include the -v option
*doesn't* seem to echo all the gruesome details regardless of whether
I use an administrator or non-administrator account.

1. Can anyone suggest a cause and/or solution to the inability of the
non-administrator to shell out?

2. What about why the -v option doesn't seem to work when included in
vim's shell option?

3. Can anyone suggest another way to troubleshoot the inability of the
non-administrator account to shell out?

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AndyHancock  
View profile  
 More options Aug 27 2012, 2:05 am
Newsgroups: comp.unix.shell, comp.unix.questions, alt.comp.lang.shell.unix.bourne-bash, comp.unix.misc, alt.unix
From: AndyHancock <andymhanc...@gmail.com>
Date: Sun, 26 Aug 2012 23:05:51 -0700 (PDT)
Local: Mon, Aug 27 2012 2:05 am
Subject: Re: Debug the skipping of .bashrc when bang out from vim PC version
Sorry, typo corrected below.

This should have been written:

    :redir @a
    !!ls
    :w !cat
    :redir END


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AndyHancock  
View profile  
 More options Aug 28 2012, 12:43 am
Newsgroups: comp.unix.shell, comp.unix.questions, alt.comp.lang.shell.unix.bourne-bash, comp.unix.misc, alt.unix
From: AndyHancock <andymhanc...@gmail.com>
Date: Mon, 27 Aug 2012 21:43:27 -0700 (PDT)
Local: Tues, Aug 28 2012 12:43 am
Subject: Re: Debug the skipping of .bashrc when bang out from vim PC version
On Aug 27, 1:55 am, AndyHancock <andymhanc...@gmail.com> wrote:

Here's some more information.  Both accounts have the same .bashrc,
which sets the $PATH.  I rely on the -i option supplied to the bash
command to force the execution of .bashrc.  I was hoping that the -v
command would show me that .bashrc was running by echoing the
statements, but it doesn't.  I even put in

   echo Running bashrc

in the .bashrc, but no message shows (and no such text is sent to vim
register a).  Another confirmation that .bashrc is not being executed
is that I shell out with

   !!echo $PATH

and the path is the same as "echo %PATH%" issued from a DOS prompt.

Here is another test that I tried.  Logged in under the
non-administrator account, I ran the PC-based gvim as LocalAdmin.
That alone does not allow shelling out, even though I am prompted for
LocalAdmin's password when launching gvim.  I had to run gvim with
elevated privileges before I could shell out.  This entails running as
Administrator (not as LocalAdmin, though the process still invokes an
authentication window for LocalAdmin's password).  Only then would

   !!echo $PATH

give the path set by bashrc.  Otherwise, it gives a path that is
identical to %PATH% in a DOS shell.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »