Date: Thu, 26 Jun 2008 07:39:28 -0500 From: Derek Ragona <derek@computinginnovations.com> To: juri_mian@yahoo.com, freebsd-questions@freebsd.org Subject: Re: why can't I use $1 in .cshrc ? Message-ID: <6.0.0.22.2.20080626073450.02589ce0@mail.computinginnovations.com> In-Reply-To: <510944.89845.qm@web45604.mail.sp1.yahoo.com> References: <510944.89845.qm@web45604.mail.sp1.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20080626073450.02589ce0>