1

Please note that this is NOT the "command not found problem" where the path is incomplete. External commands appear to start OK and immediately seek terminal input instead of producing terminal output.

I suppose that I've hosed my .profile / .bashrc files or such... but I can't see the cause of my problem.

I start cygwin bash interactive using mintty 2.5.1 (i686-pc-cygwin). A few scripts run, and then I see the $ prompt. shopt -x is set so I see commands echo.

(MinGW is also installed, and in the DOS path after cygwin.)

Any external command I type responds by reading lines from the terminal. The only way I can get the $ prompt back is by doing some number of ctrl-c and enters.

Here's the terminal output, starting with the scripts kicked off by cygwin. Perhaps somewhere at the front will be my error. At the end I attempt to run commands "mount" and "man mount" which echo the command with a lead "+" (from shopt -x) and then read input.

    + '[' -z '' ']'
    + : /usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE
    + '[' addwinpath = addwinpath ']'
    + PATH='/usr/local/bin:/usr/bin:/usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE'
    + INFOPATH=/usr/local/info:/usr/share/info:/usr/info
    ++ /usr/bin/id -un
    + USER=User
    + unset TMP TEMP
    + TMP=/tmp
    + TEMP=/tmp
    + p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device'
    + '[' -e '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' ']'
    + read -r PRINTER
    + PRINTER='HP LaserJet Professional P1606dn'
    + unset p
    + umask 022
    + '[' '!' -d '/c/Documents and Settings/User' ']'
    + readonly PROFILEREAD=true
    + PROFILEREAD=true
    + '[' '!' -z '' ']'
    + cd '/c/Documents and Settings/User'
    ++ /usr/bin/hostname
    + HOSTNAME=hej
    + profile_d sh
    + _LC_ALL_SET_=
    + _LC_SAVE_=null
    + LC_ALL=C
    + '[' null = null ']'
    + for file in '/etc/profile.d/*.$1'
    + '[' -e /etc/profile.d/lang.sh ']'
    + . /etc/profile.d/lang.sh
    ++ test -z ''
    +++ /usr/bin/locale -uU
    ++ export LANG=en_US.UTF-8
    ++ LANG=en_US.UTF-8
    + for file in '/etc/profile.d/*.$1'
    + '[' -e /etc/profile.d/tzset.sh ']'
    + . /etc/profile.d/tzset.sh
    ++ test -z ''
    +++ /usr/bin/tzset
    ++ export TZ=America/New_York
    ++ TZ=America/New_York
    + unset LC_ALL
    + unset file
    + unset _LC_ALL_SET_
    + unset _LC_SAVE_
    + '[' '!' 'x4.3.46(6)-release' = x ']'
    + '[' -f /etc/bash.bashrc ']'
    + . /etc/bash.bashrc
    ++ [[ -z '' ]]
    ++ CYG_SYS_BASHRC=1
    ++ [[ himxBH != *i* ]]
    ++ export 'EXECIGNORE=*.dll'
    ++ EXECIGNORE='*.dll'
    ++ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
    + export PROFILEREAD PATH ORIGINAL_PATH INFOPATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL
    + echo '.profile in  C:\Documents and Settings\User\.profile'
    .profile in  C:\Documents and Settings\User\.profile
    + set -x
    ++ uname -o
    + [[ Cygwin == \C\y\g\w\i\n ]]
    + export CYGDRIVE=/cygdrive
    + CYGDRIVE=/cygdrive
    + export 'PATH=./://cygdrive/c/bin:/usr/local/bin:/usr/bin:/usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE:/c/Documents and Settings/User'
    + PATH='./://cygdrive/c/bin:/usr/local/bin:/usr/bin:/usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE:/c/Documents and Settings/User'
    + export HOME=/cygdrive/g/GNU-GCC/home/User
    + HOME=/cygdrive/g/GNU-GCC/home/User
    + cd /cygdrive/g/GNU-GCC/home/User
    + '[' -f /cygdrive/g/GNU-GCC/home/User/.bashrc ']'
    + . /cygdrive/g/GNU-GCC/home/User/.bashrc
    ++ set -o notify
    ++ set -o noclobber
    ++ set -o ignoreeof
    ++ set -o nounset
    ++ set -o xtrace
    ++ alias 'debug=set -o nounset; set -o xtrace'
    ++ ulimit -S -c 0
    ++ shopt -s checkhash
    ++ shopt -s checkwinsize
    ++ shopt -s sourcepath
    ++ shopt -s no_empty_cmd_completion
    ++ shopt -s cmdhist
    ++ shopt -s histappend histreedit histverify
    ++ shopt -s extglob
    ++ shopt -s nocaseglob
    ++ shopt -s expand_aliases
    ++ shopt -u cdspell
    ++ shopt -u cdable_vars
    ++ shopt -u mailwarn
    ++ unset MAILCHECK
    ++ alias cls=clsb
    ++ set +u
    ++ [[ -z '' ]]
    ++ unalias cls
    ++ alias 'cls=tput reset'
    ++ set -u
    ++ alias 'rm=rm -i'
    ++ alias 'cp=cp -i'
    ++ alias 'mv=mv -i'
    ++ alias h=history
    ++ alias 'j=jobs -l'
    ++ alias 'which=type -a'
    ++ alias '..=cd ..'
    ++ alias 'path=echo -e ${PATH//:/\\n}'
    ++ alias 'libpath=echo -e ${LD_LIBRARY_PATH//:/\\n}'
    ++ alias 'du=du -kh'
    ++ alias 'df=df -kTh'
    ++ alias 'pushnullglob=local nullglob=$(shopt -p nullglob) ; shopt -s nullglob'
    ++ alias 'popnullglob=$nullglob ; unset nullglob'
    ++ alias 'ls=ls -h --color'
    ++ alias 'lx=ls -lXB'
    ++ alias 'lk=ls -lSr'
    ++ alias 'lt=ls -ltr'
    ++ alias 'lc=ls -ltcr'
    ++ alias 'lu=ls -ltur'
    ++ alias 'll=ls -lv --group-directories-first'
    ++ alias 'lm=ll |more'
    ++ alias 'lr=ll -R'
    ++ alias 'la=ll -A'
    ++ alias 'tree=tree -Csuh'
    ++ alias more=less
    ++ export PAGER=less
    ++ PAGER=less
    ++ export LESSCHARSET=latin1
    ++ LESSCHARSET=latin1
    ++ export 'LESSOPEN=|/usr/bin/lesspipe.sh %s 2>&-'
    ++ LESSOPEN='|/usr/bin/lesspipe.sh %s 2>&-'
    ++ export 'LESS=-i -w -s -z-4 -g -M -X -r -f -P%t?f%f \
    :stdin .?pb%pb\%:?lbLine %lb:?bbByte %bb:-...'
    ++ LESS='-i -w -s -z-4 -g -M -X -r -f -P%t?f%f \
    :stdin .?pb%pb\%:?lbLine %lb:?bbByte %bb:-...'
    ++ export 'LESS_TERMCAP_mb='
    ++ LESS_TERMCAP_mb=''
    ++ export 'LESS_TERMCAP_md='
    ++ LESS_TERMCAP_md=''
    ++ export 'LESS_TERMCAP_me='
    ++ LESS_TERMCAP_me=''
    ++ export 'LESS_TERMCAP_se='
    ++ LESS_TERMCAP_se=''
    ++ export 'LESS_TERMCAP_so='
    ++ LESS_TERMCAP_so=''
    ++ export 'LESS_TERMCAP_ue='
    ++ LESS_TERMCAP_ue=''
    ++ export 'LESS_TERMCAP_us='
    ++ LESS_TERMCAP_us=''
    ++ export -f wcd
    ++ [[ C:\Documents and Settings\User == \C\:\\\U\s\e\r\s\\\j\a\r\e\d ]]
    ++ export GNUGCC=/cygdrive/g/GNU-GCC
    ++ GNUGCC=/cygdrive/g/GNU-GCC
    ++ alias 'stamp=export STAMP=`date +D%Y%m%d.T%H%M%S`; export LOGS=`pwd`/logs/${STAMP};  mkdir -pv ${LOGS}'
    ++ alias 'gcd=cd /cygdrive/g/GNU-GCC/toolchain-avr'
    ++ alias 'gcc=cd /cygdrive/g/GNU-GCC/toolchain-avr/gcc-build; stamp; ../gcc/libgcc/configure'
    ++ alias 'avr=gcd; stamp; (build_package-avr-gcc.bash "$STAMP" "$LOGS" 2>&1) | tee $LOGS/_package.log'
    ++ alias 'avo=gcd; stamp; (package-avr-gcc.bash 2>&1) | tee $LOGS/_package.log'
    ++ alias -p
    alias ..='cd ..'
    alias avo='gcd; stamp; (package-avr-gcc.bash 2>&1) | tee $LOGS/_package.log'
    alias avr='gcd; stamp; (build_package-avr-gcc.bash "$STAMP" "$LOGS" 2>&1) | tee $LOGS/_package.log'
    alias cls='tput reset'
    alias cp='cp -i'
    alias debug='set -o nounset; set -o xtrace'
    alias df='df -kTh'
    alias du='du -kh'
    alias gcc='cd /cygdrive/g/GNU-GCC/toolchain-avr/gcc-build; stamp; ../gcc/libgcc/configure'
    alias gcd='cd /cygdrive/g/GNU-GCC/toolchain-avr'
    alias h='history'
    alias j='jobs -l'
    alias la='ll -A'
    alias lc='ls -ltcr'
    alias libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
    alias lk='ls -lSr'
    alias ll='ls -lv --group-directories-first'
    alias lm='ll |more'
    alias lr='ll -R'
    alias ls='ls -h --color'
    alias lt='ls -ltr'
    alias lu='ls -ltur'
    alias lx='ls -lXB'
    alias more='less'
    alias mv='mv -i'
    alias path='echo -e ${PATH//:/\\n}'
    alias popnullglob='$nullglob ; unset nullglob'
    alias pushnullglob='local nullglob=$(shopt -p nullglob) ; shopt -s nullglob'
    alias rm='rm -i'
    alias stamp='export STAMP=`date +D%Y%m%d.T%H%M%S`; export LOGS=`pwd`/logs/${STAMP};  mkdir -pv ${LOGS}'
    alias tree='tree -Csuh'
    alias which='type -a'

    User@hej ~
    $ shopt
    + shopt
    autocd          off
    cdable_vars     off
    cdspell         off
    checkhash       on
    checkjobs       off
    checkwinsize    on
    cmdhist         on
    compat31        off
    compat32        off
    compat40        off
    compat41        off
    compat42        off
    complete_fullquote      on
    direxpand       off
    dirspell        off
    dotglob         off
    execfail        off
    expand_aliases  on
    extdebug        off
    extglob         on
    extquote        on
    failglob        off
    force_fignore   on
    globstar        off
    globasciiranges off
    gnu_errfmt      off
    histappend      on
    histreedit      on
    histverify      on
    hostcomplete    on
    huponexit       off
    interactive_comments    on
    lastpipe        off
    lithist         off
    login_shell     on
    mailwarn        off
    no_empty_cmd_completion on
    nocaseglob      on
    nocasematch     off
    nullglob        off
    progcomp        on
    promptvars      on
    restricted_shell        off
    shift_verbose   off
    sourcepath      on
    xpg_echo        off

    User@hej ~
    $ set
    + set
    ALLUSERSPROFILE='C:\Documents and Settings\All Users'
    APPDATA='C:\Documents and Settings\User\Application Data'
    BASH=/bin/bash
    BASHOPTS=checkhash:checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:histappend:histreedit:histverify:hostcomplete:interactive_comments:login_shell:no_empty_cmd_completion:nocaseglob:progcomp:promptvars:sourcepath
    BASH_ALIASES=()
    BASH_ARGC=()
    BASH_ARGV=()
    BASH_CMDS=()
    BASH_LINENO=()
    BASH_SOURCE=()
    BASH_VERSINFO=([0]="4" [1]="3" [2]="46" [3]="6" [4]="release" [5]="i686-pc-cygwin")
    BASH_VERSION='4.3.46(6)-release'
    CLIENTNAME=Console
    COLUMNS=132
    COMMONPROGRAMFILES='C:\Program Files\Common Files'
    COMPUTERNAME=HEJ
    COMSPEC='C:\WINDOWS\System32\CMD.EXE'
    CYGDRIVE=/cygdrive
    CYGWIN_HOME='C:\cygwin'
    CYG_SYS_BASHRC=1
    CommonAppData='C:\Documents and Settings\All Users\Application Data'
    CommonDesktop='C:\Documents and Settings\All Users\Desktop'
    CommonDocuments='C:\Documents and Settings\All Users\Documents'
    CommonFavorites='C:\Documents and Settings\All Users\Favorites'
    CommonMusic='C:\Documents and Settings\All Users\Documents\My Music'
    CommonPictures='C:\Documents and Settings\All Users\Documents\My Pictures'
    CommonTemplates='C:\Documents and Settings\All Users\Templates'
    CommonVideos='C:\Documents and Settings\All Users\Documents\My Videos'
    DIRSTACK=()
    DefaultUserProfile='C:\Documents and Settings\Default User'
    DevMgr_Show_Details='*'
    DevMgr_Show_NonPresent_Devices='*'
    EUID=197614
    EXECIGNORE='*.dll'
    FP_NO_HOST_CHECK=NO
    GNUGCC=/cygdrive/g/GNU-GCC
    GROUPS=()
    HISTFILE='/c/Documents and Settings/User/.bash_history'
    HISTFILESIZE=500
    HISTSIZE=500
    HOME=/cygdrive/g/GNU-GCC/home/User
    HOMEDRIVE=C:
    HOMEPATH='\Documents and Settings\User'
    HOSTNAME=hej
    HOSTTYPE=i686
    IFS=$' \t\n'
    IGNOREEOF=10
    INFOPATH=/usr/local/info:/usr/share/info:/usr/info
    JD2_HOME='C:\Documents and Settings\User\Local Settings\Application Data\JDownloader 2.0'
    LANG=en_US.UTF-8
    LESS=$'-i -w -s -z-4 -g -M -X -r -f -P%t?f%f \\\n:stdin .?pb%pb\\%:?lbLine %lb:?bbByte %bb:-...'
    LESSCHARSET=latin1
    LESSOPEN='|/usr/bin/lesspipe.sh %s 2>&-'
    LESS_TERMCAP_mb=$'\E[01;31m'
    LESS_TERMCAP_md=$'\E[01;31m'
    LESS_TERMCAP_me=$'\E[0m'
    LESS_TERMCAP_se=$'\E[0m'
    LESS_TERMCAP_so=$'\E[01;44;33m'
    LESS_TERMCAP_ue=$'\E[0m'
    LESS_TERMCAP_us=$'\E[01;32m'
    LINES=80
    LOGONSERVER='\\HEJ'
    MACHTYPE=i686-pc-cygwin
    MTPPKROOT='C:\WMSDK\MTPPK12\Responder'
    NUMBER_OF_PROCESSORS=2
    OLDPWD='/c/Documents and Settings/User'
    OPTERR=1
    OPTIND=1
    ORIGINAL_PATH='/usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE'
    OS=Windows_NT
    OSTYPE=cygwin
    PAGER=less
    PATH='./://cygdrive/c/bin:/usr/local/bin:/usr/bin:/usr/bin:/c:/c/tools:/c/WINDOWS/System32:/c/WINDOWS:/c/WINDOWS/System32/WBEM:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/cgywin/bin:/c/MinGW/bin:/c/Documents and Settings/All Users/Application Data/Oracle/Java/javapath:/c/Program Files/rexx.org/Regina:/c/Program Files/rexx.org/THE:/c/Documents and Settings/User'
    PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.REX;.Rexx;.PSC1'
    PIPESTATUS=([0]="0")
    PPID=944
    PRINTER='HP LaserJet Professional P1606dn'
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER='x86 Family 15 Model 6 Stepping 2, GenuineIntel'
    PROCESSOR_LEVEL=15
    PROCESSOR_REVISION=0602
    PROFILEREAD=true
    PROGRAMFILES='C:\Program Files'
    PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
    PS2='> '
    PS4='+ '
    PSModulePath='C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\'
    PWD=/cygdrive/g/GNU-GCC/home/User
    REGINA_HOME='C:\Program Files\rexx.org\Regina'
    REGINA_LANG=en
    REGINA_LANG_DIR='C:\Program Files\rexx.org\Regina'
    SESSIONNAME=Console
    SHELL=/bin/bash
    SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:ignoreeof:interactive-comments:monitor:noclobber:notify:nounset:xtrace
    SHLVL=1
    SYSTEMDRIVE=C:
    SYSTEMROOT='C:\WINDOWS'
    TEMP=/tmp
    TERM=xterm
    THE_HELP_FILE='C:\Program Files\rexx.org\THE\THE_Help.txt'
    THE_HOME_DIR='C:\Program Files\rexx.org\THE'
    THE_MACRO_PATH='C:\Program Files\rexx.org\THE\extras'
    TMP=/tmp
    TZ=America/New_York
    UID=197614
    USER=User
    USERDOMAIN=HEJ
    USERNAME=User
    USERPROFILE='C:\Documents and Settings\User'
    WINDIR='C:\WINDOWS'
    _=shopt
    _NT_SYMBOL_PATH='srv*c:\symbols*https://msdl.microsoft.com/download/symbols'
    profile_d ()
    {
        _LC_ALL_SET_="${LC_ALL+set}";
        _LC_SAVE_="${LC_ALL-null}";
        LC_ALL=C;
        if [ "${_LC_SAVE_}" = "null" ]; then
            for file in /etc/profile.d/*.$1;
            do
                [ -e "${file}" ] && . "${file}";
            done;
            unset LC_ALL;
        else
            for file in /etc/profile.d/*.$1;
            do
                [ -e "${file}" ] && LC_ALL="${_LC_SAVE_}" . "${file}";
            done;
            LC_ALL="${_LC_SAVE_}";
        fi;
        unset file;
        unset _LC_ALL_SET_;
        unset _LC_SAVE_
    }
    wcd ()
    {
        cd $(sed -e 's~\\~/~g' -e 's~c:~$CYGDRIVE/c~g' -e 's~g:~$CYGDRIVE/g~' <<< "$@")
    }

    User@hej ~
    $ mount
    + mount

Ctrl-c entered <------


    User@hej ~
    $

    User@hej ~
    $

    User@hej ~
    $ man mount
    + man mount
Ctrl-c entered <------


    User@hej ~
    $

DOS Path:

PATH=C:\cygwin\bin\;C:\;c:\tools;C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\WBEM;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\cgywin\bin;C:\MinGW\bin;C:\Documents and Settings\All Users\Application Data\Oracle\Java\javapath;C:\Program Files\rexx.org\Regina;C:\Program Files\rexx.org\THE
  • For some reason, external commands started having incredibly poor performance. In frustration, I typed "FSTAB --help" (enter) and walked away, When I can back an hour later, I saw "bash: fstab: command not found". Further experiments showed a wait of at least 20 seconds. "man mount" took over a minute. Internal commands and Windows proper remain nice an snappy. Before this started, I was seeing response times of 1 second or less. shopt and set still run instantly. – HiTechHiTouch Oct 10 '16 at 8:49
1

I "broke" my system by adding entries to FSTAB for my local volumes like this:

# /etc/fstab
#
#    This file is read once by the first process in a Cygwin process tree.
#    To pick up changes, restart all Cygwin processes.  For a description
#    see https://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
none /cygdrive cygdrive binary,posix=0,user 0 0

c:/ /c ntfs text,posix=0 0 0
d:/ /d ntfs text,posix=0 0 0
f:/ /f ntfs text,posix=0 0 0
g:/ /g ntfs text,posix=0 0 0

I "repaired" it by changing fstab to:

none /cygdrive cygdrive binary,posix=0,user 0 0
none /tmp usertemp binary,posix=0 0 0

c:/  /c  ntfs binary,posix=0,cygexec 0 0
d:/  /d  ntfs binary,posix=0,cygexec 0 0
f:/  /f  ntfs binary,posix=0,cygexec 0 0
g:/  /g  ntfs binary,posix=0,cygexec 0 0

What I think happened is that by not mounting 4 drives (c,d,f,g) as "exec", every time cygwin went searching for an external it opened and read a large number of files looking for "magic" bytes" to see if the file was an executable.

Meanwhile, mintty was buffering what I entered as "type ahead" until I ctrl-c'd out, killing the still running search for my command.

By adding "cygexec" to the options, the search now consults only the executable flags in the directories, and runs full speed ahead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.