why can't I use $1 in .cshrc ?
Pietro Cerutti
gahr at FreeBSD.org
Thu Jun 26 14:32:00 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
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 ?
Try with \!\!:1
Example:
alias say echo 'I say \!\!:1'
| say hello
I say hello
|
| Thanks.
You're welcome.
- --
Pietro Cerutti
gahr at FreeBSD.org
PGP Public Key:
http://gahr.ch/pgp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
iEYEAREKAAYFAkhjqFkACgkQwMJqmJVx944z4QCeKf5wirL9TOqAy0QhyUt7f0mE
/2AAoJB1nkUYSfd4/QEdmJUEENaUsA12
=zK3x
-----END PGP SIGNATURE-----
More information about the freebsd-questions
mailing list