SVN_EDITOR in windows + git bash + svn - windows

I am trying to live with Windows (at least have to on working environment)... And I do not like cygwin actually. I am using git-bash as minimal env.
I would like to use vim as my favourite editor. After setting SVN_EDITOR to vim
export SVN_EDITOR=/bin/vim
And I have stopped on the error
'C:/Program' is not recognized as an internal or external command, operable program or batch file.
svn: E200012: system('C:/Program Files (x86)/Git/bin/vim svn-prop.tmp') returned 1
Setting vim to some more stylish dir, playing slashes and quotes didn't help. Also finally I have looked throw those issues on stackoverflow, but with no success
svn errors out strangely
Getting error trying to commit using Subversion on Mac OS X
Finally I've resolved issue by following. Hope that helps to anybody.
export SVN_EDITOR=bash /bin/vim --noplugins

You have to escape the spaces and the parentheses in your path:
export SVN_EDITOR='C:/Program\ Files\ \(x86\)/Vim/vim74/gvim.exe'
Otherwise , you'll get No such file or directory for not having escaped spaces and sh: -c: line 0: syntax error near unexpected token `(' if you forgot to escape the parentheses in your path.

Related

opening Sublime text from Git Bash but getting comamand not found

i messed up a little bit in my GIt Bash, I added an alias and can't get rid of it. whenever l launce Git Bash I get this error right away:
bash: alias: alias: not found
and when I'm trying to run subl I am getting this error message:
bash: C:Program: command not found
even though it is added in my environment variables, however, I am able to open it in CMD. could be the alias is causing the issue? if that's the case how can I get rid of it?
That error looks like you have the alias path defined incorrectly.
Your alias for subl also looks like it is using a Windows path. The examples below are from my dev machine for my GitExtension and Powershell aliases on a Windows machine.
Take note how it is using a unix style path wrapped in single quotes and without a space between the equal sign and the first single quote mark.
alias ps='"/c/windows/system32/windowspowershell/v1.0/powershell.exe"'
alias gite='"/c/Program Files (x86)/GitExtensions/GitExtensions.exe"'
Comment out the alias that you are having problems with to troubleshoot this alias issue. The aliases are typically defined in the .gitconfig file. Mine is located at c:\Users\nbstrat\.gitconfig.
From the path you specified in the comments above, updated your subl alias path to this:
alias subl='"/C/Program Files/Sublime Text 3/sublime_text.exe"'
Close your current git bash shell and then restart git bash so it will reload the updated aliases.

error message: -bash: syntax error near unexpected token `('

I am installing software, and the last line (here is the picture of my terminal 1) delivers the message: -bash: syntax error near unexpected token `(' . I was thinking that I need to insert a backward slash somewhere in between the parentheses in the command line that gave me the error message when I ran it. However, I am skeptical of having to change anything because this line is from NASA from a tutorial to install certain software (seems pretty official). Thank you!
It looks like you're following the instructions at this website:
https://heasarc.gsfc.nasa.gov/lheasoft/install.html
And you've copied this command into your terminal
gunzip -c heasoft6.26(src|arch).tar.gz | tar xf -
The command isn't meant to be copied literally, the writers intend you replace the "(src|arch)" part to match the file you've downloaded.
Check what files exist in your directory by running ls -l
When you see the file you're looking for, run the command again with the correct filename.
For example if you downloaded the pre-compiled binary for OS X, run:
gunzip -c heasoft-6.26.1mac_intel_darwin18_patch.tar.gz | tar xf -

Getting `No such file or directory` when executing any terminal command (caused by VMware Fusion)

I am using macOS High Sierra and I am getting the following error when trying to install a script:
sh: Fusion.app/Contents/Public:/Users/<name>/.rvm/bin: No such file or directory
Apparently has something to do either with rvm or Fusion.app, which I don't have that app, what I have is VMWare Fusion.app.
VMWare changes your $PATH variable, but it does not do in .profile, or /etc/profile, neither the globals or locals bashrc or zshrc files.
It has its own file inside /etc/paths.d. The file is called com.vmware.fusion.public.
You need sudo rights to change the file:
$ sudo vim /etc/paths.d/com.vmware.fusion.public
The file is readonly and it has as content:
/Applications/VMware Fusion.app/Contents/Public
Notice there are not quotes around it, and the space character is not escaped. You need to add a \ after the VMWare and before the white space.
Final result:
/Applications/VMware\ Fusion.app/Contents/Public
Quit vim with :x!.
Open a new terminal window and run your command again, you should not have that error anymore.
With VMware Fusion rewriting /etc/paths.d/com.vmware.fusion.public on launch;
Adding this PATH find and replace line to my .bash_profile seems to be working:
export PATH=${PATH//VMware\ F/VMware\\ F}
This happens because some shell script (in this case perhaps rvm) is not following best practices, specifically:
Double quote to prevent globbing and word splitting
https://github.com/koalaman/shellcheck/wiki/SC2086
Changing /etc/paths.d/com.vmware.fusion.public as suggested in other answers could break all other places where this variable is wrapped in double quotes.

error while trying to run a script in cygwin

unexpected end of file.
now I did a search on the error and I understand that my script file (that was created in windows) has wrong endings. I also read that I can use dos2unix command on the file to fix this.
however, I've tried that and cygwin tells me:
-bash: dos2unix: command not found
other than cygwin I work on a remote unix terminal, on which my script runs fine and there is even a dos2unix command. I've used it on the script file, and tried to use the converted file in cygwin with the same unexpected end of file error.
so what are my options?
You can install dos2unix from the cygwin setup utility
But, this should work too:
sed -i 's/\r$//' file
However, "unexpected end of file" often means you have an open quote (or brace or parenthesis) with no close quote (or brace or parenthesis)

mac terminal blowup: unexpected EOF errors

I've used virtualenv to program using my mac terminal for about 1/2 a year w/no issues. Suddenly today I began to get relative path errors when I tried to load python. There was no apparent reason for it, and eventually I tried restarting my computer.
Then I opened a new terminal window, and these new errors were present for the first time:
-bash: eval: line 4: unexpected EOF while looking for matching `"'
-bash: eval: line 5: syntax error: unexpected end of file
I assume the two misbehaviors are related in some way. Any idea what would be causing it? What files could the terminal be looking at that would cause this? AFIAK, I haven't changed anything on which it would depend.
Thx for any advice!
My guess is that a bash startup file (~/.bashrc, or possibly /etc/profile, ~/.bash_profile, ~/.bash_login or ~/.profile) contains a syntax error, and that causes all sorts of errors for other programs because the setup of the environment they expect does not take place.
From the error message it seems like an unterminated string constant, i.e. a missing ".
The bash manual on startup files has information about this.
You can also try to start bash in debug mode (bash -x (interactive shell) or bash -lx ( login shell)) to try to identify the error.

Resources