Adding an alias to .cshrc
Jerry McAllister
jerrymc at msu.edu
Wed Dec 30 15:38:04 UTC 2009
On Tue, Dec 29, 2009 at 07:50:21PM -0500, Steve Bertrand wrote:
> Hi all, happy holidays!
>
> I want to add an alias to my .cshrc file:
>
> alias srm find . -name "*~" | xargs rm
>
Your problem is quoting the command. It has multiple parts
with white space, so it all needs to be quoted. Something like:
alias srm "find . -name \"*~\" | xargs rm"
////jerry
> ...so that I have an easy way to remove the temp files left by svn.
>
> After adding the alias, logging out and then back in, I get an error
> stating:
>
> acct-dev: ISP-RADIUS % srm
> srm: Command not found.
>
> I thought that perhaps the file wasn't being read upon login, so I
> appended a new alias underneath:
>
> alias srm find . -name "*~" | xargs rm
> alias sll ls -lA
>
> ...which works fine when called after re-login.
>
> I even went as far as to prefix the find/xargs command with full paths,
> to no avail.
>
> Is this a problem with the pipe in the alias directive? The command
> works on the CLI, as I literally copy/pasted it into the .cshrc file.
>
> Steve
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions
mailing list