From owner-freebsd-questions@FreeBSD.ORG Thu Jun 26 12:39:52 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C8C2106567A for ; Thu, 26 Jun 2008 12:39:52 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id B49E68FC17 for ; Thu, 26 Jun 2008 12:39:46 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.14.2/8.14.2) with ESMTP id m5QCdUmR039116; Thu, 26 Jun 2008 07:39:31 -0500 (CDT) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20080626073450.02589ce0@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Thu, 26 Jun 2008 07:39:28 -0500 To: juri_mian@yahoo.com, freebsd-questions@freebsd.org From: Derek Ragona In-Reply-To: <510944.89845.qm@web45604.mail.sp1.yahoo.com> References: <510944.89845.qm@web45604.mail.sp1.yahoo.com> Mime-Version: 1.0 X-Antivirus: avast! (VPS 080626-0, 06/26/2008), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: ClamAV 0.93/6806/Wed Apr 16 15:50:16 2008 on betty.computinginnovations.com X-Virus-Status: Clean X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: m5QCdUmR039116 X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: why can't I use $1 in .cshrc ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2008 12:39:52 -0000 At 07:04 AM 6/26/2008, Juri Mianovich wrote: >I am trying to use this alias in my root .cshrc file: > >grep $1 /some/file > >but .cshrc _refuses_ to expand $1 as a proper variable (in this case, the >first argument to the alias...) > >I _think_ it's because $1 is being interpreted as a argument to csh >_itself_ when it runs .cshrc ... but maybe I'm wrong. > >Anyway, how to make it work ? > >Thanks. > I think you are trying to use an alias where it won't really work. A typical alias is: la for ls -a ll for ls -lA It looks like you want to pass an argument and a filename, or at least an argument to grep. Not quite sure if that would work or if it would be much use. The $ is a special character that is interpreted and expanded by the shell. You can use it by escaping it or putting it in quotes, but that depends on where it is used (in .cshrc, in a script, etc.) -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.