X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_RW,TW_WX,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4D9B913F.3070303@cygwin.com> References: <4D9B913F DOT 3070303 AT cygwin DOT com> Date: Wed, 6 Apr 2011 07:16:06 +0100 Message-ID: Subject: Re: .profile not sourced? From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 5 April 2011 23:01, Larry Hall (Cygwin) wrote: > On 4/5/2011 4:47 PM, philippe roux wrote: >> >> Hello, >> >> I have a file ~/.profile which contains some alias like >> >> alias la=3D'ls -la' >> >> and ./bash_profile file containing the lines >> >> # source the users profile if it exists >> if [ -f "${HOME}/.profile" ] ; then >> source "${HOME}/.profile" >> fi >> >> when i launch the default shell (mintty) from the cygwin.bat short cuts I >> get > > mintty is a terminal emulator, not a shell. =C2=A0bash is a shell. > >> 8<--8<--8<--8<--8<-- first window 8<--8<--8<--8<--8<--8<-- >> $ la >> total 33 >> drwxr-xr-x+ 1 philippe None 0 Apr 5 21:37 . >> drwxrwxrwt+ 1 philippe root 0 Apr 5 17:52 .. >> -rw------- 1 philippe None 2869 Apr 5 22:33 .bash_history >> -rwxr-xr-x 1 philippe None 1206 Apr 5 22:19 .bash_profile >> -rwxr-xr-x 1 philippe None 5663 Apr 3 21:33 .bashrc >> -rwxr-xr-x 1 philippe None 1461 Apr 3 21:34 .inputrc >> -rwxr-xr-x 1 philippe None 1695 Apr 5 22:18 .profile >> >> $ mintty & >> 8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<-- >> >> but in the new mintty window alias are not sourced : >> >> 8<--8<--8<--8<-- second window 8<--8<--8<--8<--8<--8<--8<-- >> $ la >> bash: la: command not found >> >> 8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<-- >> >> what should i modify to recover my alias? > > Do what cygwin.bat does - invoke bash as a login shell: > > run mintty -e /bin/bash --login -i Or just do 'mintty -' to tell mintty to invoke your default shell, which normally is bash, as a login shell. Even better, don't change cygwin.bat at all and use the mintty shortcut in the Cygwin folder of the start menu, which is created when installing mintty through setup.exe. Just copy/pin it to wherever you want it. Starting mintty directly from a shortcut has the advantage that you don't get a console window flickering up for the batch file. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple