Alias file not working in Bash on WSL (Opensuse Leap 42.3)












1















I have my alias file set up like so in Bash in WSL:



alias gvim='/mnt/d/Vim/vim81/gvim.exe'
alias vim='/mnt/d/Vim/vim81/vim.exe'
alias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow'


but when I try running gvim or vim within Bash, I get this error:



:No such file or directorym.exe (gvim)



`:No such file or directory.exe' (vim)



However, the pngcrush alias works correctly. For some odd reason though, the aliases defined in my ~/.alias file have the first "a" in alias replaced with single quote and the ending single quote is missing when I run alias command in bash without arguments.



Anyone know why the gvim and vim executables are not being found correctly? If I enter the path to the .exe in bash directly it works but those two aliases don't work



Bash version:



> bash --version
GNU bash, version 4.3.42(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


OpenSUSE version:



> cat /etc/*release
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
openSUSE 42.3 (x86_64)
VERSION = 42.3
CODENAME = Malachite
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead


All of my bash aliases below:



>alias
alias +='pushd .'
alias -='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias beep='echo -en "07"'
alias cd..='cd ..'
alias dir='ls -l'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
'lias gvim='/mnt/d/Vim/vim81/gvim.exe
alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'
alias md='mkdir -p'
alias o='less'
'lias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow
alias rd='rmdir'
alias rehash='hash -r'
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
'lias vim='/mnt/d/Vim/vim81/vim.exe
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'


Microsoft Windows 10 Home 10.0.17134










share|improve this question























  • Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

    – dave_thompson_085
    Jul 20 '18 at 14:27













  • Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

    – Biswapriyo
    Jul 20 '18 at 15:37











  • I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

    – Nathan Mills
    Jul 21 '18 at 20:35











  • okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

    – Nathan Mills
    Jul 21 '18 at 20:40
















1















I have my alias file set up like so in Bash in WSL:



alias gvim='/mnt/d/Vim/vim81/gvim.exe'
alias vim='/mnt/d/Vim/vim81/vim.exe'
alias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow'


but when I try running gvim or vim within Bash, I get this error:



:No such file or directorym.exe (gvim)



`:No such file or directory.exe' (vim)



However, the pngcrush alias works correctly. For some odd reason though, the aliases defined in my ~/.alias file have the first "a" in alias replaced with single quote and the ending single quote is missing when I run alias command in bash without arguments.



Anyone know why the gvim and vim executables are not being found correctly? If I enter the path to the .exe in bash directly it works but those two aliases don't work



Bash version:



> bash --version
GNU bash, version 4.3.42(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


OpenSUSE version:



> cat /etc/*release
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
openSUSE 42.3 (x86_64)
VERSION = 42.3
CODENAME = Malachite
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead


All of my bash aliases below:



>alias
alias +='pushd .'
alias -='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias beep='echo -en "07"'
alias cd..='cd ..'
alias dir='ls -l'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
'lias gvim='/mnt/d/Vim/vim81/gvim.exe
alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'
alias md='mkdir -p'
alias o='less'
'lias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow
alias rd='rmdir'
alias rehash='hash -r'
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
'lias vim='/mnt/d/Vim/vim81/vim.exe
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'


Microsoft Windows 10 Home 10.0.17134










share|improve this question























  • Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

    – dave_thompson_085
    Jul 20 '18 at 14:27













  • Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

    – Biswapriyo
    Jul 20 '18 at 15:37











  • I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

    – Nathan Mills
    Jul 21 '18 at 20:35











  • okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

    – Nathan Mills
    Jul 21 '18 at 20:40














1












1








1








I have my alias file set up like so in Bash in WSL:



alias gvim='/mnt/d/Vim/vim81/gvim.exe'
alias vim='/mnt/d/Vim/vim81/vim.exe'
alias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow'


but when I try running gvim or vim within Bash, I get this error:



:No such file or directorym.exe (gvim)



`:No such file or directory.exe' (vim)



However, the pngcrush alias works correctly. For some odd reason though, the aliases defined in my ~/.alias file have the first "a" in alias replaced with single quote and the ending single quote is missing when I run alias command in bash without arguments.



Anyone know why the gvim and vim executables are not being found correctly? If I enter the path to the .exe in bash directly it works but those two aliases don't work



Bash version:



> bash --version
GNU bash, version 4.3.42(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


OpenSUSE version:



> cat /etc/*release
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
openSUSE 42.3 (x86_64)
VERSION = 42.3
CODENAME = Malachite
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead


All of my bash aliases below:



>alias
alias +='pushd .'
alias -='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias beep='echo -en "07"'
alias cd..='cd ..'
alias dir='ls -l'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
'lias gvim='/mnt/d/Vim/vim81/gvim.exe
alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'
alias md='mkdir -p'
alias o='less'
'lias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow
alias rd='rmdir'
alias rehash='hash -r'
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
'lias vim='/mnt/d/Vim/vim81/vim.exe
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'


Microsoft Windows 10 Home 10.0.17134










share|improve this question














I have my alias file set up like so in Bash in WSL:



alias gvim='/mnt/d/Vim/vim81/gvim.exe'
alias vim='/mnt/d/Vim/vim81/vim.exe'
alias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow'


but when I try running gvim or vim within Bash, I get this error:



:No such file or directorym.exe (gvim)



`:No such file or directory.exe' (vim)



However, the pngcrush alias works correctly. For some odd reason though, the aliases defined in my ~/.alias file have the first "a" in alias replaced with single quote and the ending single quote is missing when I run alias command in bash without arguments.



Anyone know why the gvim and vim executables are not being found correctly? If I enter the path to the .exe in bash directly it works but those two aliases don't work



Bash version:



> bash --version
GNU bash, version 4.3.42(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


OpenSUSE version:



> cat /etc/*release
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
openSUSE 42.3 (x86_64)
VERSION = 42.3
CODENAME = Malachite
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead


All of my bash aliases below:



>alias
alias +='pushd .'
alias -='popd'
alias ..='cd ..'
alias ...='cd ../..'
alias beep='echo -en "07"'
alias cd..='cd ..'
alias dir='ls -l'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
'lias gvim='/mnt/d/Vim/vim81/gvim.exe
alias l='ls -alF'
alias la='ls -la'
alias ll='ls -l'
alias ls='_ls'
alias ls-l='ls -l'
alias md='mkdir -p'
alias o='less'
'lias pngcrush='/mnt/c/Users/nathan/Downloads/pngcrush_1_8_11_w64.exe -reduce -brute -ow
alias rd='rmdir'
alias rehash='hash -r'
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
'lias vim='/mnt/d/Vim/vim81/vim.exe
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'


Microsoft Windows 10 Home 10.0.17134







windows-10 vim opensuse windows-subsystem-for-linux bash-alias






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 20 '18 at 12:28









Nathan MillsNathan Mills

63




63













  • Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

    – dave_thompson_085
    Jul 20 '18 at 14:27













  • Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

    – Biswapriyo
    Jul 20 '18 at 15:37











  • I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

    – Nathan Mills
    Jul 21 '18 at 20:35











  • okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

    – Nathan Mills
    Jul 21 '18 at 20:40



















  • Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

    – dave_thompson_085
    Jul 20 '18 at 14:27













  • Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

    – Biswapriyo
    Jul 20 '18 at 15:37











  • I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

    – Nathan Mills
    Jul 21 '18 at 20:35











  • okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

    – Nathan Mills
    Jul 21 '18 at 20:40

















Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

– dave_thompson_085
Jul 20 '18 at 14:27







Check if your alias file has CRLF line-endings e.g. with cat -v[et] or sed -n l (ell).

– dave_thompson_085
Jul 20 '18 at 14:27















Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

– Biswapriyo
Jul 20 '18 at 15:37





Change the alias to another name like: alias wvim='/mnt/d/Vim/vim81/vim.exe'. The vim alias may conflict with the Windows path and Linux path. +1 for this well formatting question.

– Biswapriyo
Jul 20 '18 at 15:37













I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

– Nathan Mills
Jul 21 '18 at 20:35





I tried cat -v ~/.alias and each line ends with a ^M. Does that mean I need to run dos2unix on it?

– Nathan Mills
Jul 21 '18 at 20:35













okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

– Nathan Mills
Jul 21 '18 at 20:40





okay tried dos2unix on the alias file and the gvim alias seems to work but the aliased vim just hangs now if I run it from bash using either the alias or the path to the exe but works fine when I run that exe from Cortana. Guess I'll remove that particular alias and keep the other two. Thanks for the help dave and Biswapriyo.

– Nathan Mills
Jul 21 '18 at 20:40










1 Answer
1






active

oldest

votes


















1














Quick answer: just open vim from within bash.



The Linux distribution you are using with WSL probably has vim included. There is no reason to use WSL & bash to open a Windows version of vim.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1341852%2falias-file-not-working-in-bash-on-wsl-opensuse-leap-42-3%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Quick answer: just open vim from within bash.



    The Linux distribution you are using with WSL probably has vim included. There is no reason to use WSL & bash to open a Windows version of vim.






    share|improve this answer




























      1














      Quick answer: just open vim from within bash.



      The Linux distribution you are using with WSL probably has vim included. There is no reason to use WSL & bash to open a Windows version of vim.






      share|improve this answer


























        1












        1








        1







        Quick answer: just open vim from within bash.



        The Linux distribution you are using with WSL probably has vim included. There is no reason to use WSL & bash to open a Windows version of vim.






        share|improve this answer













        Quick answer: just open vim from within bash.



        The Linux distribution you are using with WSL probably has vim included. There is no reason to use WSL & bash to open a Windows version of vim.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 10 at 14:40









        Tom SaenenTom Saenen

        112




        112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1341852%2falias-file-not-working-in-bash-on-wsl-opensuse-leap-42-3%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”