X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4D344C60.2000608@redhat.com> References: <4D344C60 DOT 2000608 AT redhat DOT com> From: Julio Costa Date: Mon, 17 Jan 2011 15:13:17 +0000 Message-ID: Subject: Re: alias command not effective 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 Mon, Jan 17, 2011 at 14:04, Eric Blake wrote: > > On 01/17/2011 01:24 AM, Thomas Wiedmann wrote: > > Hello, > > > > After defining an alias, e. g. > > > > =C2=A0alias laf=3D'ls -la' | grep -v "^d" > > That defined an alias in the subshell used to form the pipeline. > Aliases in child processes do not affect the parent process. > And, using my "paranormal powers", I'd say the command line the OP wants is: alias laf=3D'ls -la | grep -v "^d"' (note the second quote char was moved to the end) > > laf > > bash:: laf: command not found > > Because the parent process still doesn't have an alias defined. > > > > > What may be the reason, that the use of an alias, defined, had not been > > accepted? > > What has to be done to resolve this problem? > > Don't pipe the output of alias into another command, thereby avoiding > the subshell that would limit the alias to just the child shell. > He never wanted to pipe the alias command :) The real answer is: Double-check the quoting rules, so that pipe char doesn't get interpreted by bash. > This is not cygwin-specific. > ditto. ___________ Julio Costa -- 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